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=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,fea50f781bb229dc X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Symbolic tracebacks on Debian Date: Sun, 23 May 2010 16:52:32 +0100 Organization: A noiseless patient Spider Message-ID: References: <85f51aeb-cac9-4591-921a-a7f50c8ef142@a21g2000yqn.googlegroups.com> <1pup1z7a4f1pq$.of30sejrqe4m.dlg@40tude.net> <87hbmae33k.fsf@ludovic-brenta.org> <85j595F1lqU1@mid.individual.net> <87sk5navk6.fsf_-_@ludovic-brenta.org> <82bpc8s17m.fsf@stephe-leake.org> <82eih2rblr.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Sun, 23 May 2010 15:52:34 +0000 (UTC) Injection-Info: mx03.eternal-september.org; posting-host="KCXegvZb5vh43D+f3BR6Ew"; logging-data="8914"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/n7ZjqIG9y+KlLD9yAlXc/METzGi/7TS8=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (darwin) Cancel-Lock: sha1:Z1b6i4NU9YMJ8wDXUNw6tlGASbQ= sha1:ESBjRo+RYu5S9ztnQ6yF95gR1q0= Xref: g2news2.google.com comp.lang.ada:11899 Date: 2010-05-23T16:52:32+01:00 List-Id: Stephen Leake writes: > Simon Wright writes: > >> "(see below)" writes: >> >>> On 21/05/2010 09:52, in article 82bpc8s17m.fsf@stephe-leake.org, "Stephen >>> Leake" wrote: >> >>>> Because symbolic traceback are not supported on _all_ gnat platforms, I >>>> don't use them on _any_ - that way my code is portable. So I did not >>>> notice this problem. >>>> >>>> I dump the stack trace as hex addresses, then later run addr2line >>>> manually if I want the symbolic trace. >>> >>> Can you say exactly what the steps are to do that? >>> I've never understood it + therefore never used it. >> >> You need to call >> >> GNAT.Exception_Traces.Trace_On >> (Kind => GNAT.Exception_Traces.Unhandled_Raise); > > I never do this. > >> from somewhere in your program and run gnatmake with -bargs -E. > > I only do this if I want symbolic traces from the running program, which > I don't anymore. If you want _symbolic_ traces you add GNAT.Exception_Traces.Set_Trace_Decorator (Decorator => GNAT.Traceback.Symbolic.Symbolic_Traceback'Access); Actually, there is a difference: this code with GNAT.Exception_Traces; procedure T is Foo, Bar : exception; task T is entry Start; end T; task body T is begin accept Start; raise Bar; end T; begin GNAT.Exception_Traces.Trace_On (Kind => GNAT.Exception_Traces.Unhandled_Raise); T.Start; raise Foo; end T; results in $ ./t Unhandled Exception raised Exception name: T.FOO Message: t.adb:16 Call stack traceback locations: 0x100001577 0x10000141b task t_0000000100800E00 terminated by unhandled exception Exception name: T.BAR Message: t.adb:10 Call stack traceback locations: 0x100001742 0x10000aa82 0x7fff825fb8b4 whereas with the Trace_On call commented out, it generates $ ./t Execution terminated by unhandled exception Exception name: T.FOO Message: t.adb:16 Call stack traceback locations: 0x10000157d 0x10000142b so you get to see the unhandled exceptions in tasks too.