From: "Alejandro R. Mosteo" <alejandro@mosteo.com>
Subject: Re: GNAT compiler versions and addr2line
Date: Wed, 22 Aug 2018 17:14:42 +0200
Date: 2018-08-22T17:14:42+02:00 [thread overview]
Message-ID: <pljul2$2af$1@dont-email.me> (raw)
In-Reply-To: <pljms6$jol$1@dont-email.me>
On 22/08/18 15:01, Phil wrote:
> Hi,
>
> I'm having problems getting useful debugging data from some GNAT
> versions. If I use the Debian FSF version (6.3.0), I get very little
> useful unless running inside gdb. In particular, the trace addresses
> don't resolve to anything through addr2line.
I have seen the same up to current 7.3 FSF Ubuntu versions, and still
haven't found a workaround :/
Alex.
>
> Given this test program:
> $ cat foo.adb
> procedure Foo is
>
> procedure Able is
> begin
> raise Constraint_Error with "It broke";
> end Able;
>
> procedure Baker is
> begin
> Able;
> end Baker;
>
> begin
> Baker;
> end Foo;
>
> Check the compiler version:
>
> $ gnatmake --version
> GNATMAKE 6.3.0
> […]
>
> Build with debug info and binder argument -E:
>
> $ gnatmake -g foo -bargs -E
> […]
>
> Run and try to use addr2line to get more information:
> $ ./foo
> Execution terminated by unhandled exception
> raised CONSTRAINT_ERROR : It broke
> Call stack traceback locations:
> 0x55654f763530 0x55654f763566 0x55654f76354c 0x55654f7634e8 0x7f11a88292df 0x55654f763238 0xfffffffffffffffe
>
> $ addr2line -e foo -f 0x55654f763530 0x55654f763566 0x55654f76354c 0x55654f7634e8 0x7f11a88292df 0x55654f763238 0xfffffffffffffffe
> ??
> ??:0
> […and repeats ??, ??:0…]
>
> Now, gdb using “catch exception” and “bt” will show some debugging:
> (gdb) bt
> #0 <__gnat_debug_raise_exception> (e=0x5555557560c0 <constraint_error>,
> message=...) at s-excdeb.adb:40
> #1 0x00007ffff797603e in ada.exceptions.complete_occurrence (
> x=x@entry=0x555555757050) at a-except.adb:925
> #2 0x00007ffff797604d in ada.exceptions.complete_and_propagate_occurrence (
> x=x@entry=0x555555757050) at a-except.adb:936
> #3 0x00007ffff79760a0 in <__gnat_raise_exception> (
> e=0x5555557560c0 <constraint_error>, message=...) at a-except.adb:978
> #4 0x0000555555555532 in foo.able () at foo.adb:5
> #5 0x0000555555555568 in foo.baker () at foo.adb:10
> #6 0x000055555555554e in foo () at foo.adb:14
> So the debugging data is accessible (somehow).
>
> The same problem occurs with version 7.3.0 (from Debian unstable). It
> works if I use the current AdaCore community version instead:
>
> $ gnatmake --version
> GNATMAKE Community 2018 (20180524-73)
> $ ./foo
>
> Execution of ./foo terminated by unhandled exception
> raised CONSTRAINT_ERROR : It broke
> Call stack traceback locations:
> 0x4024e4 0x402519 0x402500 0x402473 0x7fb92acb72df 0x4020b8 0xfffffffffffffffe
> $ addr2line -e foo -f 0x4024e4 0x402519 0x402500 0x402473 0x7fb92acb72df 0x4020b8 0xfffffffffffffffe
> foo__able
> /tmp/ada/foo.adb:5
> foo__baker
> /tmp/ada/foo.adb:10
> _ada_foo
> /tmp/ada/foo.adb:14
> main
> /tmp/ada/b~foo.adb:185
> […]
>
>
> I started looking at this because of problems using GNAT.Traceback.Symbolic
> (the 6.3.0 version has a stub version isn't useful). Getting
> addr2line working would be very helpful. I assume (hope!) it's a
> PBCAK issue — does anyone have a suggestion for getting addr2line
> working with the Debian/FSF versions? Am I missing something on the
> command line?
>
> TIA,
>
> Phil.
>
>
>
>
next prev parent reply other threads:[~2018-08-22 15:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-22 13:01 GNAT compiler versions and addr2line Phil
2018-08-22 13:50 ` Egil H H
2018-08-22 14:39 ` Phil
2018-08-22 14:15 ` gautier_niouzes
2018-08-22 14:41 ` Phil
2018-08-22 15:14 ` Alejandro R. Mosteo [this message]
2018-08-22 18:21 ` Phil
2018-08-22 19:43 ` Anh Vo
2018-08-22 20:30 ` Randy Brukardt
2018-08-23 18:00 ` Phil
2018-08-22 17:40 ` Jeffrey R. Carter
2018-08-22 21:10 ` Brian Drummond
2018-08-23 17:21 ` Simon Wright
2018-08-23 17:50 ` Phil
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox