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=0.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1891a615e17f3e4c X-Google-Attributes: gid103376,public From: davpatrick@aol.com (DavPatrick) Subject: Re: Determining exception name in DEC Ada Date: 1995/04/07 Message-ID: <3m2f40$6f4@newsbf02.news.aol.com>#1/1 X-Deja-AN: 100070339 sender: root@newsbf02.news.aol.com references: organization: America Online, Inc. (1-800-827-6364) reply-to: davpatrick@aol.com (DavPatrick) newsgroups: comp.lang.ada Date: 1995-04-07T00:00:00+00:00 List-Id: Yes .. sort of. I just did this for my current project. First it should be noted that in DEC Ada, exceptions are implemented using the exception mechanism built into VMS. What I did was first write a routine ( actually modify a routine written by somebody else ) that was, using VMS system services, added to the chain of procedures that are called in response to an exception ( I'll get into this in detail in a second ). When this procedure is called ( in response to an exception ( ada, VMS or other ) ) it saves off two parameters from the call stack. One of these parameters is the PC of instruction that caused the exception and the second one is a 32 bit value indicating the exception. If its a VMS predefined exception then you can use one of the system servies to convert the number to a string identifying the exception, if its a user-defined exception ( ie an exception defined in the ada code ) then the number is a pointer to a string that contains the name of the package. Anyhow, this first routine stores these values off in a package-body level variable and then I have two other procedures that I can call from with-in the "when others =>" exception handler branch that references these global variables and return strings indicating the exception name and PC. I recommend looking at the VMS documation for how the condition handling & chaining works. I could provide you with detail and source code ( I'd have to do some work on my own time to strip any references to my project ). The real question is .. does anybody know how to convert the PC to a source module & line # the way the debugger does ? e-mail me at DavPatrick@aol.com and we can continue this further, in greater detail when I have my resources in front of me.