comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Package name
Date: Wed, 16 May 2001 13:24:03 -0500
Date: 2001-05-16T13:24:03-05:00	[thread overview]
Message-ID: <PDzM6.2903$A07.445082@homer.alpha.net> (raw)
In-Reply-To: 9du16o$fr3$1@nh.pace.co.uk

Marin David Condic wrote in message <9du16o$fr3$1@nh.pace.co.uk>...
>It would be useful for diagnostics in the event of various errors or
other
>conditions. Maybe even have "Current_Context'Line_Number" and similar
>capabilities? One would wish that Exception_Message and
>Exception_Information had this sort of information in their returned
strings
>(Never seen it myself in the implementations I've used)...

You've obviously never used Janus/Ada. It includes a complete traceback
of the calls in Exception_Information:

   ** Unhandled CONSTRAINT_ERROR
      Index or Subtype out of bounds - Pos of Error Value =  12
   On Line Number 7 In PROC.FOO.BAR
   Called from line number 123 In PROC.FOO
   Called from line number 11 In PROC

(It always has had this, but there wasn't a clean way to get it in Ada
83 except to let the program terminate with an unhandled exception.)
This is a godsend when debugging. (It also keeps limited information
about reraised exceptions, so the original traceback isn't lost.)

All of the Claw exception handlers display Exception_Information in
order to be able to access this information. On some compilers,
Exception_Information is pretty useless (and we try to debug Claw with
other compilers, usually Janus/Ada and GNAT) unless the problem is
compiler-specific. One problem with Claw is that many exceptions are
raised by a subprogram Raise_Windows_Error (which sets up an appropriate
Exception_Message), so you need the line number and package of the call
to that routine in order to find out anything useful. Only Janus/Ada
gives enough information to easily debug such exceptions.

                Randy Brukardt.


            Randy.






  parent reply	other threads:[~2001-05-16 18:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-16 12:56 Package name Atle R�stad
2001-05-16 13:28 ` Preben Randhol
2001-05-16 13:46   ` Atle R�stad
2001-05-16 14:00   ` Marin David Condic
2001-05-16 16:45     ` Claude SIMON
2001-05-17 13:59       ` Marin David Condic
2001-05-17 15:06         ` Samuel T. Harris
2001-05-16 18:24     ` Randy Brukardt [this message]
2001-05-16 16:10 ` Jeffrey Carter
2001-05-16 17:08 ` David C. Hoos, Sr.
  -- strict thread matches above, loose matches on Subject: below --
2001-05-16 16:17 Beard, Frank
2001-05-16 18:11 ` tmoran
replies disabled

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