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!.POSTED!not-for-mail From: Natasha Kerensikova Newsgroups: comp.lang.ada Subject: Re: How to get nice traceback with GNAT? Date: Sat, 22 Nov 2014 09:45:16 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: Injection-Date: Sat, 22 Nov 2014 09:45:16 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="76a49b86bc3e16725b7cfca3d85cb4c8"; logging-data="30559"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/5en27F2WHA48aDNtpe7Nf" User-Agent: slrn/1.0.1 (FreeBSD) Cancel-Lock: sha1:hv5nYcx2pwIEiknEFeiaMNm+FE8= Xref: news.eternal-september.org comp.lang.ada:23635 Date: 2014-11-22T09:45:16+00:00 List-Id: On 2014-11-21, Randy Brukardt wrote: > "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. Indeed I am, but I don't think portability in debugging is that important: I only need a set of tools that work on the platform where debugging is performed. So when dealing with portable/fundamental bugs, I'm free to choose the platform where the best tools for that task are available. >>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 It might be nitpicking, but as far as the traceback (word I unfortunately missed in the subject) you actually provide less information: GNAT has function name, file name, line number, while yours lacks the file name (might be easy to find out, but that's still a mental overhead nonetheless). As far as the exception message goes, I agree that yours is quite impressive. I didn't mention it in the OP because I'm actually chasing user exceptions (explicit raise statements), so I have the power to improve the exception message. Compare to the traceback, which is to tied to the compiler internals that a mere user has no power to improve anything. I can't even guess what is going in GNAT to get so wildly different outputs on different platforms. Natasha