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,2c0bee8a07770dd4 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: [Gnat] Finding exceptions without gdb Date: 1996/11/05 Message-ID: #1/1 X-Deja-AN: 194669495 references: organization: New York University newsgroups: comp.lang.ada Date: 1996-11-05T00:00:00+00:00 List-Id: Bob Collins asks "Is there any way to find out where (in source) exceptions are raised without using gdb? (And without Put-ting the information in excception handlers.)" No, you need to use gdb to get the traceback to find out where an exception occured (exept on the VMS version, where the system provides traceback facilities). We assume incidentally you are talking about GNAT (Remember to say so, it is not always easy to guess!) Note that gdb is completely non-intrusive, it does not affect your program in any way up to the point where a breakpoint is hit, so one thing you can do is to set up scripts that routinely run udner control of gdb (Mike Feldman does this for his students). Incidentally, it is not a matter of philosophy that you have to use the debugger to get tracebacks, just a mmatter of practicality. Providing traceback capability for a given architecture is hard work, but possible, as you see in several compilers, but providing it in a target independent manner is extremely difficult. One of the disadvantages of the GCC approach is that since it is so incredibly portable (and ported to hundreds of targets), in order to maintain this portablity, we have to be very wary of target dependent code. Eventually we hope to see a general solution to this (the problem is related to the issue of general exception handling). Meanwhile, using gdb to solve the problem is easier than you might think, given the guarantee that it is a non-intrusive debugger, and of course, once you are in gdb you have more capability than just getting a traceback.