comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: GNAT exception traceback
Date: 1997/06/17
Date: 1997-06-17T00:00:00+00:00	[thread overview]
Message-ID: <dewar.866540788@merv> (raw)
In-Reply-To: 01bc7a82$c57186a0$2a208b82@wd


Wiljan said

<<Note that this will only allow to get to the exception raised by the main
program.
When exceptions happen in tasks they simply disappear without a message
or anything from the program (at least on NT).
I myself made a small patch to a-raise.c so that it will generate a
traceback
whenever a constraint error is raised. This patch only works on ix86
machines.>>


A couple of points.

First: The slient disappearence of exceptions raised in tasks is *required*
by the Ada language. The semantics of an unhandled exception is that it
silently terminates the task in which it appears if this is not the
environment task. This is not considered an error by the language definition.

(Note: I personally think this is an annoying little mistake in the definition
of the language, what would be so terrible in requiring programmers to write

   when others => null;

at the top level of a task, if you really want this [typically undesirable]
behavior?)

That being said, in practice, for programs which do not use Constraint_Error
as a control structure in the program (one would hope that would be nearly
all programs, but sadly this is not the case), considering Constraint_Error
to be always fatal is a very reasonable idea.

Two ways of persuing this are to always run under control of GDB setting
a conditional breakpoint on __gnat_raise that will break only if the
exception is CE, or more directly (and still catching nearly all cases)
by breaking on the constraint error entry directly.

Or, as Wiljan notes, you can hack a-raise.c.
The idea of using GDB to determine the program location, given a hex
location, is certainly a reasonable one, though in general you really
want the traceback which GDB can give you.





  reply	other threads:[~1997-06-17  0:00 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-13  0:00 GNAT exception traceback Huy Vo
1997-06-13  0:00 ` Robert Dewar
1997-06-16  0:00   ` wiljan
1997-06-17  0:00     ` Robert Dewar [this message]
1997-06-17  0:00       ` Robert A Duff
1997-06-19  0:00         ` Michael F Brenner
1997-06-17  0:00       ` Spam Hater
1997-06-17  0:00         ` Corey Minyard
1997-06-17  0:00           ` Spam Hater
1997-06-18  0:00             ` Corey Minyard
1997-06-18  0:00               ` Spam Hater
1997-06-18  0:00                 ` Tom Moran
1997-06-20  0:00                   ` Robert Dewar
1997-06-19  0:00                 ` Corey Minyard
1997-06-20  0:00                 ` Robert Dewar
1997-06-20  0:00                 ` Richard Kenner
1997-06-18  0:00         ` Richard Kenner
1997-06-23  0:00   ` Geert Bosch
1997-06-27  0:00     ` Michael F Brenner
1997-07-02  0:00     ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-06-19  0:00 Chris Sparks (Mr. Ada)
1997-06-16  0:00 Chris Sparks (Mr. Ada)
1997-06-16  0:00 ` Robert Dewar
1997-06-11  0:00 Steve Gibson
1997-06-12  0:00 ` Robert Dewar
1997-06-13  0:00   ` Mats.Weber
1997-06-14  0:00     ` Robert Dewar
1997-06-16  0:00       ` Mats.Weber
1997-06-16  0:00         ` Robert Dewar
1997-06-16  0:00         ` Fergus Henderson
1997-06-16  0:00     ` Gautier
1997-06-17  0:00       ` Robert Dewar
1997-06-14  0:00   ` Aaron Metzger
1997-06-14  0:00     ` Robert Dewar
1997-06-14  0:00       ` Robert A Duff
1997-06-16  0:00       ` Spam Hater
1997-06-17  0:00         ` Robert Dewar
1997-06-17  0:00         ` Robert Dewar
1997-06-16  0:00       ` Corey Minyard
1997-06-16  0:00     ` Spam Hater
1997-06-17  0:00       ` Robert Dewar
1997-06-19  0:00         ` Geert Bosch
1997-06-18  0:00       ` Richard Kenner
1997-06-18  0:00       ` Samuel Tardieu
1997-06-14  0:00 ` Martin Kristensson
1997-06-14  0:00   ` Robert Dewar
     [not found] <82@pluto.win-uk.net>
1996-02-17  0:00 ` GNAT : Exception traceback Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox