comp.lang.ada
 help / color / mirror / Atom feed
* RE: Package name
@ 2001-05-16 16:17 Beard, Frank
  2001-05-16 18:11 ` tmoran
  0 siblings, 1 reply; 12+ messages in thread
From: Beard, Frank @ 2001-05-16 16:17 UTC (permalink / raw)
  To: 'comp.lang.ada@ada.eu.org'


-----Original Message-----
From: Marin David Condic [mailto:marin.condic.auntie.spam@pacemicro.com]

> I think the idea is to have something like a pragma or attribute that lets
> you get the name of the module you are in as a string. I have frequently
> wished I could write a more general exception handler (or error handler or
> simple messages at runtime...) by having something like "Context'Image" or
> some other function that would provide the fully qualified name of the
> subprogram, package, whatever that I am currently in. Example:
>
> package body Some_Package is
>    procedure Some_Procedure is
>        ....
>        Put_Line ("Running in: " & Current_Context'Image) ;
>
> having that print:
>
> Running in: Standard.Some_Package.Some_Procedure

The Aonix ObjectAda compiler on Windows NT, returns the Package,
Procedure, and line number when Exception_Information is called.
That is, assuming you produced the executable with at least
CodeView debugging included.  If you build the executable without
any debugging, then all you get is useless addresses.

For general debugging, we had to defined our own constants.  The
PACKAGE_NAME/CLASS_NAME was defined globally in the package body,
while each procedure or function had a local constant (METHOD_NAME).
It would have been really nice to have something like Context'image,
as Marin suggests.

Frank




^ permalink raw reply	[flat|nested] 12+ messages in thread
* Package name
@ 2001-05-16 12:56 Atle R�stad
  2001-05-16 13:28 ` Preben Randhol
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Atle R�stad @ 2001-05-16 12:56 UTC (permalink / raw)


Is it possible to print out the package name?

It would be a nice feature in tracing. Maybe even print the
procedure/function name.

Regards Atle





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2001-05-17 15:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-16 16:17 Package name Beard, Frank
2001-05-16 18:11 ` tmoran
  -- strict thread matches above, loose matches on Subject: below --
2001-05-16 12:56 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
2001-05-16 16:10 ` Jeffrey Carter
2001-05-16 17:08 ` David C. Hoos, Sr.

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