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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71aa44b9692e8206 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-16 09:18:15 PST Path: archiver1.sj.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!jussieu.fr!enst!enst.fr!not-for-mail From: "Beard, Frank" Newsgroups: comp.lang.ada Subject: RE: Package name Date: Wed, 16 May 2001 12:17:10 -0400 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: avanie.enst.fr 990029894 54066 137.194.161.2 (16 May 2001 16:18:14 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 16 May 2001 16:18:14 +0000 (UTC) To: "'comp.lang.ada@ada.eu.org'" Return-Path: X-Mailer: Internet Mail Service (5.5.2448.0) Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.3 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , List-Archive: Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.sj.google.com comp.lang.ada:7566 Date: 2001-05-16T12:17:10-04:00 -----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