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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,91c5b958fecf5eff X-Google-Attributes: gid103376,public From: Aaron Metzger Subject: Re: GNAT exception traceback Date: 1997/06/14 Message-ID: <33A22F37.41CBA26B@erols.com>#1/1 X-Deja-AN: 248294675 References: <339EFAE3.26C@ccis.adisys.com.au> Organization: Erol's Internet Services X-Received-On: 14 Jun 1997 01:39:33 GMT Newsgroups: comp.lang.ada Date: 1997-06-14T00:00:00+00:00 List-Id: Robert Dewar wrote: > > Steve asks > > < handlers, is it possible to generate traceback information to determine > which line of code in which package generated the exception, and if so > how ? > >> > > You need to run gdb to get the traceback. This is easy to do, so it is > not clear why you set the precondition of not using it (your question is > a bit like saying: can I use GNAT to compile my Ada program without > using gcc -- the answer in both cases is no!) I believe that Steve's question does have merit. I was going to wait until I had studied the implementation of exception handling in GNAT before posting a similar question but since someone brought it up here goes ... We develop applications written in Ada for use in embedded systems. Due to limited resources in the embedded target, the production code is generally delivered with a few judiciously placed exception handlers in outer scopes to recover the system just in case something slipped through testing and propogates an unhandled exception. The systems are first subjected to extreme operating conditions while many miles away from the software developers and a debugger. If an error occurs it is often not repeatable due to the complex environment that the system is in. This means that we get just one chance to collect all possible information about what the software was doing at the point that an exception was propagated. It would be an EXTREMELY valuable capability if the Ada.Exceptions.Exception_Information function carried with it some information about where the exception was originally raised or even better a full traceback. This may be too much baggage to justify implementation in the compiler but nevertheless it would provide a useful capability to a certain group of users. ------------- Aaron Metzger