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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.36.48.67 with SMTP id q64mr9530611itq.55.1516123305176; Tue, 16 Jan 2018 09:21:45 -0800 (PST) X-Received: by 10.157.90.130 with SMTP id w2mr500876oth.14.1516123305063; Tue, 16 Jan 2018 09:21:45 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer01.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!g80no2629594itg.0!news-out.google.com!b73ni17179ita.0!nntp.google.com!w142no2162821ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 16 Jan 2018 09:21:44 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=149.32.224.39; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 149.32.224.39 References: <4ff1db1f-cf2e-4683-9882-da9a907d07b0@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <80cb7f53-fbb4-4f7b-b874-ae7f57a63a67@googlegroups.com> Subject: Re: ADA.STRINGS.INDEX_ERROR : a-strunb.adb:782 From: Anh Vo Injection-Date: Tue, 16 Jan 2018 17:21:45 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 2683270101 X-Received-Bytes: 3495 Xref: reader02.eternal-september.org comp.lang.ada:49937 Date: 2018-01-16T09:21:44-08:00 List-Id: 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= > >> > >> 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