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!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gegeweb.org!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to get nice with GNAT? Date: Fri, 21 Nov 2014 16:55:08 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1416610510 11004 24.196.82.226 (21 Nov 2014 22:55:10 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 21 Nov 2014 22:55:10 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:23623 Date: 2014-11-21T16:55:08-06:00 List-Id: "Natasha Kerensikova" wrote in message news:slrnm6u97f.nrc.lithiumcat@nat.rebma.instinctive.eu... > Hello, > > I happen to have found a situation in which symbolic traceback is a > great help, but I have been a bit surprise by the (lack of) support in > the platform to which I have access. There is no standard for traceback, you are totally at the mercy of your compiler vendor. >In Debian/kFreeBSD, with GNAT 4.6, it looks like the following, which is >what I consider as perfect: >> 0x7fa993 in asis.ada_environments.open at asis-ada_environments.adb:241 >> 0x481a57 in adactl at adactl.adb:90 >> 0x417029 in main at b~adactl.adb:817 >> 0x8015a4347 in ?? at ??:0 >> 0x41706e in <_start> at ??:0 No, perfect is: ** Unhandled CONSTRAINT_ERROR Index or Subtype out of bounds - Pos of Error Value = -1 On Line Number 484 In J2TYPE_PROFILE_CHECKING.END_SPEC_AND_DO_DELAYED_THUNKS Called from line number 1914 In J2SEMANTIC_ROUTINES.SEMANTICS Called from line number 466 In JANUS2.SEMDRIVER Called from line number 527 In JANUS2 :-) :-) But you'd need to get Janus/Ada to get that. (Maybe it would need mixed case for the subprogram names to be even more perfect.) [It's even more perfect if the exception is re-raised, because it saves and displays part of both traces, the one of the original exception and of the place it was last re-raised.] The best you can do portably is with Exception_Message and Exception_Name; the contents of Exception_Information is implementer-defined (the above is what you'd get for Janus/Ada, but most compilers don't try that hard). And be glad that you get anything. Most of the compilers I've worked with give you nothing useful at all. (The only error message from the first C compiler I worked with was "Bus error - core dumped". Up to you to figure out anything else.) Randy.