comp.lang.ada
 help / color / mirror / Atom feed
From: davpatrick@aol.com (DavPatrick)
Subject: Re: Determining exception name in DEC Ada
Date: 1995/04/07
Date: 1995-04-07T00:00:00+00:00	[thread overview]
Message-ID: <3m2f40$6f4@newsbf02.news.aol.com> (raw)
In-Reply-To: INFO-ADA%95040611415951@VM1.NODAK.EDU

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.




  reply	other threads:[~1995-04-07  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-04-06  0:00 Determining exception name in DEC Ada RWTMS1::SSEVAX::GRAZIANIA
1995-04-07  0:00 ` DavPatrick [this message]
1995-04-07  0:00   ` DavPatrick
  -- strict thread matches above, loose matches on Subject: below --
1995-04-07  0:00 Ken Balmy
replies disabled

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