From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4c1aeced34d252fb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.8.229 with SMTP id u5mr7191532pba.0.1317947050589; Thu, 06 Oct 2011 17:24:10 -0700 (PDT) Path: lh7ni13132pbb.0!nntp.google.com!news1.google.com!postnews.google.com!f6g2000vbm.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Re: gdb will not "catch exception" or "catch exception unhandled" Date: Thu, 6 Oct 2011 17:22:47 -0700 (PDT) Organization: http://groups.google.com Message-ID: <915238bc-c2da-4a39-be8f-06997679ae56@f6g2000vbm.googlegroups.com> References: <22f84116-3c6f-449e-a02d-a2bc8863de98@t16g2000yqm.googlegroups.com> NNTP-Posting-Host: 97.117.180.49 Mime-Version: 1.0 X-Trace: posting.google.com 1317947050 9982 127.0.0.1 (7 Oct 2011 00:24:10 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 7 Oct 2011 00:24:10 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f6g2000vbm.googlegroups.com; posting-host=97.117.180.49; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HLUARECNK X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4,gzip(gfe) Xref: news1.google.com comp.lang.ada:18333 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2011-10-06T17:22:47-07:00 List-Id: On Oct 6, 3:57=A0am, Simon Wright wrote: > Jerry 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/201= 1/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