comp.lang.ada
 help / color / mirror / Atom feed
From: mgk25@cl.cam.ac.uk (Markus Kuhn)
Subject: Re: locating exceptions (was: Ada success story)
Date: 1999/03/18
Date: 1999-03-18T00:00:00+00:00	[thread overview]
Message-ID: <7cqga8$llt$1@pegasus.csx.cam.ac.uk> (raw)
In-Reply-To: 7cp9cp$743$1@nnrp1.dejanews.com

dennison@telepath.com writes:
|> In article <36efef1c.3265725@news.pacbell.net>,
|>   tmoran@bix.com (Tom Moran) wrote:
|> >   I well remember one early demo where the program got a
|> > Constraint_Error at such and such a line number.  Within a few minutes
|> > I had it explained, fixed, recompiled, and was re-running the demo.
|> > The client was impressed.  In C there would have been no error, just
|> > bad data in the database.
|> 
|> I sure wish more compiler vendors made this information (line number of an
|> exception occurrence) available without using a debugger.

Or better produce a core dump (which contains much more info than just
the line number).

That is actually the single thing I particularly dislike about
the current GNAT version: An unhandeled exception gives you
no useful information whatsoever unless you had the application
running in a debugger. But you use a debugger normally only if
you expect an error, so unexpected constraint errors cause a
lot of hazzle to locate (rerun everything inside gdb in the hope
you can reproduce the circumstances).

Things where actually easier in C: If you got a segmentation
violation, the OS would produce a core dump, in which you then can
locate with gdb not only the place where the process violated its
memory limits, but you also could inspect the values of variables
that led to this. GNAT's Ada code practically never produced a core
dump, which can be very inconvenient.

It would be a very significant improvement if the code produced by
GNAT with option -g would always produce a core dump as a result of an
unhandeled exception, with the program counter at the place where the
exception was first triggered and the call stack of all threads intact.
Then I could claim that debugging Ada is really more convenient than
debugging C because then I could use gdb as easily to dig around in the
extremely useful core files.

Markus

-- 
Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK
Email: mkuhn at acm.org,  WWW: <http://www.cl.cam.ac.uk/~mgk25/>




  parent reply	other threads:[~1999-03-18  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-14  0:00 A small Ada success story Steffen Huber
1999-03-17  0:00 ` Nick Roberts
1999-03-17  0:00 ` Tom Moran
1999-03-17  0:00   ` dennison
1999-03-18  0:00     ` Corey Ashford
1999-03-18  0:00       ` bill
1999-03-19  0:00         ` Fraser Wilson
1999-03-21  0:00           ` Ehud Lamm
1999-03-21  0:00             ` robert_dewar
1999-03-21  0:00               ` Tom Moran
1999-03-21  0:00                 ` robert_dewar
1999-03-22  0:00               ` Simon Wright
1999-03-19  0:00         ` Larry Kilgallen
1999-03-20  0:00         ` locating exceptions (Ada vs. Java) Markus Kuhn
1999-03-20  0:00           ` bill
1999-03-19  0:00       ` A small Ada success story dewar
1999-03-18  0:00     ` Markus Kuhn [this message]
1999-03-19  0:00     ` Michael F Brenner
1999-03-26  0:00       ` Steve Quinlan
replies disabled

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