comp.lang.ada
 help / color / mirror / Atom feed
From: Anh Vo <anhvofrcaus@gmail.com>
Subject: Re: ADA.STRINGS.INDEX_ERROR : a-strunb.adb:782
Date: Tue, 16 Jan 2018 09:21:44 -0800 (PST)
Date: 2018-01-16T09:21:44-08:00	[thread overview]
Message-ID: <80cb7f53-fbb4-4f7b-b874-ae7f57a63a67@googlegroups.com> (raw)
In-Reply-To: <p3l7u6$dl9$1@dont-email.me>

On Tuesday, January 16, 2018 at 8:06:33 AM UTC-8, Brian Drummond wrote:
> On Mon, 15 Jan 2018 09:22:34 -0800, Anh Vo wrote:
> 
> > On Monday, January 15, 2018 at 12:29:41 AM UTC-8, Dmitry A. Kazakov
> >> 
> >>     addr2line --exe=<program-name> <funny-numbers>
> >> 
> >> That will give you the stack trace.
> >  
> > It is even better to use GNAT addition to print out full stack trace as
> > shown in the snippet.
> > 
> > -- ...
> > 
> > exception
> > 
> > when Err : others =>
> > 
> >   Text_Io.Put_Line ("Houston we have a problem: " &
> >                                     Exceptions.Exception_Information
> >                                     (Err));
> >   Text_Io.Put_Line ("Traceback => " &
> >   GNAT.Traceback.Symbolic.Symbolic_Traceback(Err));
> > end [Ada Unit Name];
> 
> This has some issues with (FSF) Gnat 6.3 (at least on Debian Stretch).
> I asked about this on the Gnoga list, still working through the issues.
> 
> (1) It just prints out the same funny numbers, with capital letters in 
> the hex part.
> 
> (2) Feeding the funny numbers to addr2line just gives a bunch of question 
> marks.
> 
> The culprit appears to be something to do with Position Independent 
> Executables, and Address Space Randomization, which appear to have broken 
> a few things. 
> 
> Adding "-no-pie" (NOT "-Wl,-no_pie") to the Linker switches changes the 
> funny numbers, such that addr2line can now parse them, fixing (2).
> 
> However neither this nor explicitly linking libreadline (adding 
> "-lreadline" to teh linker options fixes (1). I have a feeling that when 
> (2) broke, a quick fix was added to GNAT.Traceback.Symbolic to "fix" (1).
> 
> (checking the RTS source I see a comment...
> --  This is the default implementation for platforms where the full 
> capability
> --  is not supported. It returns tracebacks as lists of hexadecimal 
> addresses
> --  of the form "0x...".
> 
> So, apparently not provided in recent-ish FSF Gnat compilers ... if it 
> ever was.

I trusted that switch -g passed during compilation, -E passed during binding and -g passed during linking.

Anh Vo

  reply	other threads:[~2018-01-16 17:21 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-15  1:18 ADA.STRINGS.INDEX_ERROR : a-strunb.adb:782 Mehdi Saada
2018-01-15  3:23 ` Niklas Holsti
2018-01-15  8:29 ` Dmitry A. Kazakov
2018-01-15 10:49   ` Simon Wright
2018-01-15 11:51     ` Mehdi Saada
2018-01-15 12:00       ` Mehdi Saada
2018-01-15 13:32         ` Dmitry A. Kazakov
2018-01-15 18:55         ` Shark8
2018-01-15 13:51       ` Simon Wright
2018-01-15 15:18         ` Mehdi Saada
2018-01-15 15:29           ` Mehdi Saada
2018-01-15 15:50             ` Mehdi Saada
2018-01-15 17:53               ` Simon Wright
2018-01-15 17:22   ` Anh Vo
2018-01-15 17:48     ` Dmitry A. Kazakov
2018-01-15 19:56       ` Anh Vo
2018-01-16 16:06     ` Brian Drummond
2018-01-16 17:21       ` Anh Vo [this message]
2018-01-15 10:37 ` Simon Wright
2018-01-15 16:06 ` Mehdi Saada
2018-01-17 19:23   ` Niklas Holsti
2018-01-16 16:24 ` Mehdi Saada
2018-01-16 18:20   ` Jacob Sparre Andersen
2018-01-16 20:00     ` Mehdi Saada
2018-01-17 15:45 ` Mehdi Saada
2018-01-17 16:30   ` Dmitry A. Kazakov
2018-01-17 22:50     ` Mehdi Saada
2018-01-18  8:34       ` Dmitry A. Kazakov
2018-01-18 11:14         ` Simon Wright
2018-01-18 11:55           ` Dmitry A. Kazakov
2018-01-18 12:21             ` Mehdi Saada
2018-01-18 13:08               ` J-P. Rosen
2018-01-18 15:23                 ` Dmitry A. Kazakov
2018-01-19  1:10                   ` Randy Brukardt
2018-01-19  8:52                     ` Dmitry A. Kazakov
2018-01-20  0:42                       ` Randy Brukardt
2018-01-20  9:47                         ` Dmitry A. Kazakov
2018-01-23  0:44                           ` Randy Brukardt
2018-01-18 14:05         ` AdaMagica
2018-01-18 14:17           ` Mehdi Saada
2018-01-18 14:56             ` J-P. Rosen
2018-01-18 15:38               ` Mehdi Saada
2018-01-19  1:13                 ` Randy Brukardt
2018-01-18 16:48             ` AdaMagica
2018-01-18 16:59               ` Dmitry A. Kazakov
2018-01-18 19:36                 ` Mehdi Saada
2018-01-19  1:21                   ` Randy Brukardt
2018-01-19 16:15                 ` AdaMagica
2018-01-19 16:58                   ` Dmitry A. Kazakov
2018-01-21 23:27             ` G.B.
replies disabled

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