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!gandalf.srv.welterde.de!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 traceback with GNAT? Date: Mon, 24 Nov 2014 16:35:52 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1416868553 24031 24.196.82.226 (24 Nov 2014 22:35:53 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 24 Nov 2014 22:35:53 +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:23706 Date: 2014-11-24T16:35:52-06:00 List-Id: "Natasha Kerensikova" wrote in message news:slrnm70mph.nrc.lithiumcat@nat.rebma.instinctive.eu... > On 2014-11-21, Randy Brukardt wrote: ... >> 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). You're right, of course, but in our defense it wasn't necessary on the CP/M and MS-DOS systems this was originally defined for. The file name was always the first 8 characters of the package name, and indeed the editor we used automatically truncated the names, so edit J2TYPE_PROFILE_CHECKING.adb would open the right file without any mental energy. Indeed, this is something that the programming environment should do for you (it knows the package to file name correspondence), so there's no real need for the file name to be in the trackback. (We wouldn't have wanted to store the file names in the object code, as they would waste a lot of space.) > 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. Right, although of course you have no control over the exception message for language-defined checks, either. And those are the ones you're usually debugging. Randy.