tag:blogger.com,1999:blog-237654800464413303.post6430858681792528870..comments2023-06-18T08:13:42.794-07:00Comments on Forward in code: Debugging and stack traces on Mac OS X LionSimon Wrighthttp://www.blogger.com/profile/13430985964728759118noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-237654800464413303.post-76088373873694949682012-02-19T01:52:14.427-08:002012-02-19T01:52:14.427-08:00Hi Simon, I got it with XCode 3.2.6.
atos have cha...Hi Simon, I got it with XCode 3.2.6.<br />atos have changed:<br />-rwxr-xr-x 1 root wheel 72368 22 jan 2010 /usr/bin/atos*<br />-rwxr-xr-x 1 root wheel 72368 24 oct 2010 /usr/bin/atos*<br />And then:<br />$ atos -o stbga -arch x86_64 0x100001898 0x100001a6b 0x1000018b4 0x100001862<br />stbga__p1.2247 (in stbga) (stbga.adb:8)<br />stbga__p2.2249 (in stbga) (stbga.adb:12)<br />_ada_stbga (in stbga) (stbga.adb:15)<br />main (in stbga) (b~stbga.adb:248)<br /><br />Many thanks, Pascal.Bladyhttps://www.blogger.com/profile/08481039954274958890noreply@blogger.comtag:blogger.com,1999:blog-237654800464413303.post-67098446917370030192012-02-04T04:57:02.002-08:002012-02-04T04:57:02.002-08:00Pascal,
I’m using Lion, and I know things have cha...Pascal,<br />I’m using Lion, and I know things have changed since Snow Leopard, but not -- I thought -- that much.<br />I talked about building GCC at http://forward-in-code.blogspot.com/2011/11/building-gcc-again.html, which includes a link to a 4.6.0 compiler - should work for you, I’m pretty sure it was built on Snow Leopard.<br />I suppose it might be worth upgrading to Xcode 3.2.6, though no guarantees!Simon Wrighthttps://www.blogger.com/profile/13430985964728759118noreply@blogger.comtag:blogger.com,1999:blog-237654800464413303.post-52522371998893648222012-02-04T01:58:27.159-08:002012-02-04T01:58:27.159-08:00Hi Simon, interesting result indeed!
On MacOSX 10....Hi Simon, interesting result indeed!<br />On MacOSX 10.6.8, I've installed: Xcode 3.2.3 and GNAT GPL 2011 with binaries from libre.adacore.com. I get :<br />$ gcc -v<br />Using built-in specs.<br />COLLECT_GCC=gcc<br />COLLECT_LTO_WRAPPER=/usr/local/gnat-2011/bin/../libexec/gcc/x86_64-apple-darwin10.2.0/4.5.3/lto-wrapper<br />Target: x86_64-apple-darwin10.2.0<br />Configured with: ../src/configure --prefix=/usr/local/gnat --with-mpc=/Volumes/lena.a/gnatmail/release-gpl/build-lena/libmpfr/install --with-gmp=/Volumes/lena.a/gnatmail/release-gpl/build-lena/libmpfr/install --with-mpfr=/Volumes/lena.a/gnatmail/release-gpl/build-lena/libmpfr/install --build=x86_64-apple-darwin10.2.0 --enable-languages=c,ada,c++ --disable-nls --without-libiconv-prefix --disable-libmudflap --disable-libstdcxx-pch --disable-libada --enable-checking=release --enable-lto --with-bugurl=URL:mailto:report@adacore.com --with-build-time-tools=/Volumes/lena.a/gnatmail/release-gpl/build-lena/obj<br />Thread model: posix<br />gcc version 4.5.3 20110419 for GNAT GPL 2011 (20110419) (GCC) <br /><br />How do you get gcc 4.6.0 with GNAT GPL 2011?<br />Would you advise me to update XCode?<br />Thanks, Pascal.Bladyhttps://www.blogger.com/profile/08481039954274958890noreply@blogger.comtag:blogger.com,1999:blog-237654800464413303.post-1257019660418713282012-01-29T03:09:45.713-08:002012-01-29T03:09:45.713-08:00Pascal,
I compiled with
$ gnatmake -f -g stbga.a...Pascal,<br />I compiled with<br /> $ gnatmake -f -g stbga.adb -bargs -E -largs -Wl,-no_pie<br /> gcc -c -g stbga.adb<br /> gnatbind -E -x stbga.ali<br /> gnatlink stbga.ali -g -Wl,-no_pie<br />then atos gave<br /> stbga__p1.2211 (in stbga) (stbga.adb:8)<br /> stbga__p2.2213 (in stbga) (stbga.adb:12)<br /> _ada_stbga (in stbga) (stbga.adb:15)<br /> main (in stbga) (b~stbga.adb:194)<br />so I don’t see where the difference is. Tried with GNAT GPL 2011 & GCC 4.6.0, both OK.<br />???Simon Wrighthttps://www.blogger.com/profile/13430985964728759118noreply@blogger.comtag:blogger.com,1999:blog-237654800464413303.post-91588704328122677382012-01-29T02:39:40.299-08:002012-01-29T02:39:40.299-08:00Hi Simon, here is the complete example:
with Ada.T...Hi Simon, here is the complete example:<br />with Ada.Text_IO; use Ada.Text_IO;<br />-- with GNAT.Traceback.Symbolic; use GNAT.Traceback.Symbolic;<br />-- with Exception_Information_Workaround;<br />with Ada.Exceptions; use Ada.Exceptions;<br />procedure STBGA is<br /> procedure P1 is<br /> begin<br /> raise Constraint_Error;<br /> end P1;<br /> procedure P2 is<br /> begin<br /> P1;<br /> end P2;<br />begin<br /> P2;<br />exception<br /> when E : others =><br /> Put_Line ("----------------------------");<br /> -- Put_Line (Exception_Information_Workaround (E));<br /> -- Put_Line (Symbolic_Traceback (E));<br /> Put_Line (Exception_Information (E));<br /> Put_Line ("----------------------------");<br />end STBGA;<br />$ gnatmake -d -Pessais.gpr stbga.adb<br />gcc -c -g -gnatwa -gnatf -gnateE -g -I- -gnatA stbga.adb<br />gnatbind -E -I- -x stbga.ali<br />gnatlink stbga.ali -g -Wl,-no_pie -o stbga<br />$ ./stbga<br />----------------------------<br />Exception name: CONSTRAINT_ERROR<br />Message: stbga.adb:8 explicit raise<br />Call stack traceback locations:<br />0x100001898 0x100001a6b 0x1000018b4 0x100001862<br />$ atos -o stbga -arch x86_64 0x100001898 0x100001a6b 0x1000018b4 0x100001862<br />stbga__p1.2247 (in stbga) + 30<br />stbga__p2.2249 (in stbga) + 21<br />_ada_stbga (in stbga) (stbga.adb:15)<br />main (in stbga) (b~stbga.adb:248)<br />Is there something wrong?<br />Thanks, Pascal.Bladyhttps://www.blogger.com/profile/08481039954274958890noreply@blogger.comtag:blogger.com,1999:blog-237654800464413303.post-89679771276855535252012-01-27T13:33:10.535-08:002012-01-27T13:33:10.535-08:00Pascal, I hate to mention the obvious, but did you...Pascal, I hate to mention the obvious, but did you build with -g?<br />Oops, I see I left that out of the example, will fix immediately.Simon Wrighthttps://www.blogger.com/profile/13430985964728759118noreply@blogger.comtag:blogger.com,1999:blog-237654800464413303.post-82816896153976322582012-01-27T12:13:16.663-08:002012-01-27T12:13:16.663-08:00Hi Simon, thanks for this useful tip.
But in my ca...Hi Simon, thanks for this useful tip.<br />But in my case there is no improvement, I get the same traceback:<br />Exception name: CONSTRAINT_ERROR<br />Message: stbga.adb:7 explicit raise<br />Call stack traceback locations:<br />stbga__p1.2247 (in stbga) + 30<br />stbga__p2.2249 (in stbga) + 21<br />_ada_stbga (in stbga) (stbga.adb:14)<br />main (in stbga) (b~stbga.adb:264)<br /><br />Is there a way to get more useful information (all trace with file and line number)?<br /><br />Thanks, Pascal.Bladyhttps://www.blogger.com/profile/08481039954274958890noreply@blogger.com