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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: GNAT compiler versions and addr2line Date: Wed, 22 Aug 2018 21:10:11 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 22 Aug 2018 21:10:11 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="7a481aa5a5469523ccd7694ff1fd837e"; logging-data="9679"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rX0X5IsYAouj4oKN4JosBrsPRKyELbXI=" User-Agent: Pan/0.141 (Tarzan's Death; 168b179 git.gnome.org/pan2) Cancel-Lock: sha1:RFGBL4QMxwlhudRxTTMGr6t4Wsg= Xref: reader02.eternal-september.org comp.lang.ada:54225 Date: 2018-08-22T21:10:11+00:00 List-Id: On Wed, 22 Aug 2018 13:01:58 +0000, 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. > Basically Debian changed its policy (possibly for security reasons) regarding Address Space Randomisation and position-independent executables - not sure exactly what, perhaps they turned on PIE by default, to allow address space randomisation. I've seen all those 5555s in addresses so treated... (not so random, then?) Anyway, apparently addr2line doesn't work so well with random addresses... My "solution" is to suppress PIE, at least while debugging. gpr snippet... package Compiler is for Default_Switches ("Ada") use ("-g", "-O1", "-gnatafo", "- gnatq", "-gnatQ", "-gnateE"); end Compiler; package Binder is for Default_Switches ("Ada") use ("-E"); end Binder; package Linker is for Default_Switches ("Ada") use ("-g", "-no-pie"); end Linker; At the very least, -no-pie to the linker is necessary, some of the others are necessary to get the traceback. Still on the lookout for a better answer too. -- Brian