See the calling standard manual
http://h71000.www7.hp.com/doc/82final/5973/5973pro.html
and the invocation context routines in the RTL
http://h71000.www7.hp.com/doc/82fina..._invo_con_rout
This is a discussion on Accessing saved registers in condition handlers - VMS ; When a condition handler gets called due to a signal, or a trap/fault, how can the handler access the saved registers of the routine where the event happened? Some of the registers are saved in the mechanism array passed to ...
When a condition handler gets called due to a signal, or a trap/fault,
how can the handler access the saved registers of the routine where
the event happened? Some of the registers are saved in the mechanism
array passed to the handler, and the PC is part of the signal array,
but some registers such as R2 aren't. The "Programming Concepts"
manual isn't clear. All it states is "Registers R2-R15 are implicitly
saved in the call chain". BTW, I am interested in the answer for
Itanium. This area is rather different between VAX, Alpha and
Itanium.
Also, how do I access info about the routine's caller, or the caller's
caller. This must be the call chain referred to.
See the calling standard manual
http://h71000.www7.hp.com/doc/82final/5973/5973pro.html
and the invocation context routines in the RTL
http://h71000.www7.hp.com/doc/82fina..._invo_con_rout
On Oct 2, 10:47 am, IanMillerwrote:
> See the calling standard manualhttp://h71000.www7.hp.com/doc/82final/5973/5973pro.html
>
> and the invocation context routines in the RTLhttp://h71000.www7.hp.com/doc/82final/5932/5932pro_023.html#get_cur_i...
Thank you. I got what I needed.
(they couldn't make it simple, could they?)
On Oct 2, 10:47 am, IanMillerwrote:
> See the calling standard manualhttp://h71000.www7.hp.com/doc/82final/5973/5973pro.html
>
> and the invocation context routines in the RTLhttp://h71000.www7.hp.com/doc/82final/5932/5932pro_023.html#get_cur_i...
OK I can call LIB$I64_GET_CURR_INVO_CONTEXT and LIB
$I64_GET_PREV_INVO_CONTEXT and walk up the frames from a condition
handler fine. How can I tell for sure which frame corresponds to the
procedure that had the exception that caused the condition handler to
be called? I match the PC from the sigargs parameter of the handler
to the PCs in the frames and that _usually_ works. One case where it
doesn't is if a procedure tries to call a routine at a bogus memory
address, generating an accvio. The PC in the sigargs structure is the
bogus address, but of course, no routine has that PC within it, so
trying to find that PC fails. Plus I'd expect it to fail if there are
recursive procedures, multiple frames may have the same PC.
There seem to always be 2 frames between the faulting procedure and
the handler. Can I assume that is _always_ the case?