comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry <lanceboyle@qwest.net>
Subject: Re: gdb will not "catch exception" or "catch exception unhandled"
Date: Thu, 6 Oct 2011 17:22:47 -0700 (PDT)
Date: 2011-10-06T17:22:47-07:00	[thread overview]
Message-ID: <915238bc-c2da-4a39-be8f-06997679ae56@f6g2000vbm.googlegroups.com> (raw)
In-Reply-To: m2aa9ez8ts.fsf@pushface.org

On Oct 6, 3:57 am, Simon Wright <si...@pushface.org> wrote:
> Jerry <lancebo...@qwest.net> writes:
> > I'm having considerable difficulty getting gdb to break on exceptions;
> > in fact, I can't get it to work at all.
>
> I wrote up something on this here:http://forward-in-code.blogspot.com/2011/08/debugging-with-mac-os-x-s...

That's really helpful, Simon. Thanks. I pretty much understood your
article which means that it's really well-written. 8^)

At your suggestion, I tried debugging under Snow Leopard's gdb. After
typing
  break __gnat_debug_raise_exception
I was able to climb up the stack to the bad line of my code and then
figure things out. Not ideal but better than what was before!

I did not understand the first part of this comment in your blog:

"HOWEVER, IF YOU CALL IN AN ADA SHARED LIBRARY BY MISTAKE (PERHAPS
BECAUSE YOU MISSED AN EXTERNAL VARIABLE SETTING IN A .GPR), the linker
will find the dynamic Ada runtime because it's referenced from the Ada
shared library:"

otool on my executable:

MBPro:product-debug me$ otool -L ./run
./run:
	/usr/local/plplot/lib/libplplotd.11.dylib (compatibility version
11.0.0, current version 11.0.0)
	@rpath/libgnat-2010.dylib (compatibility version 0.0.0, current
version 0.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 125.2.11)
	/System/Library/Frameworks/vecLib.framework/Versions/A/vecLib
(compatibility version 1.0.0, current version 268.0.1)


libplplotd is the PLplot library which I link to; this is almost
certainly referring to libgnat. But did I do something wrong? This is
the first project on which I have used gpr, and I found the gpr
documentation to be not the finest example of technical writing.

My main gpr file has this:
  with "PLplot_Library";
and
  PLplot_Library.gpr
is this:

  library project PLplot_Library is
	for Externally_Built use "true";
	for Source_Dirs use ();
	for Library_Dir use "/usr/local/plplot/lib";
	for Library_Name use "plplotd";
	for Library_Kind use "dynamic";
  end PLplot_Library;

Is there something that I could do better here or am I stuck because I
need to link to libplplotd which references libgnat?

Jerry



  reply	other threads:[~2011-10-07  0:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-06 10:48 gdb will not "catch exception" or "catch exception unhandled" Jerry
2011-10-06 10:57 ` Simon Wright
2011-10-07  0:22   ` Jerry [this message]
2011-10-07 16:34     ` Simon Wright
2011-10-08  3:54       ` Jerry
2011-10-08  8:23         ` Simon Wright
2011-10-12  2:24           ` Jerry
2011-10-12  6:45             ` Simon Wright
2011-10-13 22:39               ` Jerry
2011-10-14  7:46                 ` Simon Wright
2011-10-14 22:40                   ` Jerry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox