HP OpenVMS Calling Standard
4.8.4.3 LIB$I64_GET_GR
Given an invocation context block and general register
index such that 0 <= index <
128, copy the register value to gr_copy, for example,
index 4 fetches the invocation context block IREG[4]
value, which represents the contents of R4 for the context.
If the register represented by index has its
corresponding NaT bit set, the read succeeds and the return status is
set to 3. If the register represented by index lies
beyond the allocated general registers, the read fails and
gr_copy is unchanged. That is, the highest allowed
index is 32 + ICB.CFM.SOF - 1.
LIB$I64_GET_GR fails if the index represents a scratch register whose
contents have not been realized.
LIB$I64_GET_GR (invo_context, index, gr_copy)
|
Argument |
OpenVMS Usage |
Type |
Access |
Mechanism |
invo_context
|
invo_context_blk
|
structure
|
read
|
by reference
|
index
|
index
|
longword
|
read
|
by value
|
gr_copy
|
integer value
|
quadword
|
write
|
by reference
|
Arguments:
|
invo_context
Address of a valid invocation context block.
|
|
index
Index into the IREG array of the invocation context block.
|
|
gr_copy
Address of a quadword to receive the value from the invocation
context block.
|
Function Value Returned:
|
status
A value of 3 indicates success, and the NaT bit was set.
A value of 1 indicates success, and the NaT bit was clear.
A value of 0 indicates failure.
|
4.8.4.4 LIB$I64_SET_GR
Given an invocation context block, a general register
index such that 1 <= index <
128, and a quadword value gr_copy, writes the
corresponding invocation context block general register, clears the
corresponding NaT bit and uses LIB$I64_PUT_INVO_REGISTERS to write to
the actual context. The invocation context block remains unchanged if
the routine fails.
LIB$I64_SET_GR fails if LIB$I64_PUT_INVO_REGISTERS fails.
LIB$I64_SET_GR (invo_context, index, gr_copy)
|
Argument |
OpenVMS Usage |
Type |
Access |
Mechanism |
invo_context
|
invo_context_blk
|
structure
|
modify
|
by reference
|
index
|
index
|
longword
|
read
|
by value
|
gr_copy
|
integer value
|
quadword
|
read
|
by reference
|
Arguments:
|
invo_context
Address of a valid invocation context block.
|
|
index
Index into the IREG array of the invocation context block.
|
|
gr_copy
Address of a quadword that contains the value to be written to the
invocation context block.
|
Function Value Returned:
|
status
A value of 1 indicates success.
A value of 0 indicates failure.
|
4.8.4.5 LIB$I64_SET_PC
Given an invocation context block and a quadword PC value in
pc_copy, write the pc_copy value to
the invocation context block PC and then use LIB$I64_PUT_INVO_REGISTERS
to write to the actual context. The invocation context block remains
unchanged if the routine fails.
LIB$I64_SET_PC fails if LIB$I64_PUT_INVO_REGISTERS fails.
LIB$I64_SET_PC (invo_context, pc_copy)
|
Argument |
OpenVMS Usage |
Type |
Access |
Mechanism |
invo_context
|
invo_context_blk
|
structure
|
modify
|
by reference
|
pc_copy
|
PC value
|
quadword
|
read
|
by reference
|
Arguments:
|
invo_context
Address of a valid invocation context block.
|
|
pc_copy
Address of a quadword that contains the PC value to be written to
the invocation context block.
|
Function Value Returned:
|
status
A value of 1 indicates success.
A value of 0 indicates failure.
|
4.8.4.6 LIB$I64_GET_UNWIND_LSDA
Given a pc_value, find the address of the unwind
information block language-specific data area (LSDA), and write it to
unwind_lsda_p. If not present, then write 0 to
unwind_lsda_p.
LIB$I64_GET_UNWIND_LSDA (pc_value, unwind_lsda_p)
|
Argument |
OpenVMS Usage |
Type |
Access |
Mechanism |
pc_value
|
PC value
|
quadword
|
read
|
by reference
|
unwind_lsda_p
|
address
|
quadword
|
write
|
by reference
|
Arguments:
|
pc_value
Address of a location that contains the PC value.
pc_value is used to find the unwind information block
and the unwind information block language-specific data area address.
|
|
unwind_lsda_p
Address of a quadword to receive the address of the
language-specific data area, if there is one.
|
Function Value Returned:
|
status
A value of 1 indicates success.
A value of 0 indicates failure.
|
4.8.4.7 LIB$I64_GET_UNWIND_OSSD
Given a pc_value, find the address of the unwind
information block operating system-specific data area, if present, and
write it to unwind_ossd_p. If not present, then write
0 to unwind_ossd_p.
LIB$I64_GET_UNWIND_OSSD (pc_value, unwind_ossd_p)
|
Argument |
OpenVMS Usage |
Type |
Access |
Mechanism |
pc_value
|
PC value
|
quadword
|
read
|
by reference
|
unwind_ossd_p
|
address
|
quadword
|
write
|
by reference
|
Arguments:
|
pc_value
Address of a location that contains the PC value.
pc_value is used to find the unwind information block
and the unwind information block operating system-specific data area
address.
|
|
unwind_ossd_p
Address of a quadword to receive the address of the operating
system-specific data area.
|
Function Value Returned:
|
status
A value of 1 indicates success.
A value of 0 indicates failure.
|
4.8.4.8 LIB$I64_GET_UNWIND_HANDLER_FV
Given a pc_value, find the function value (address of
the procedure descriptor) for the condition handler, if present, and
write it to handler_fv. If not present, then write 0
to handler_fv.
LIB$I64_GET_UNWIND_HANDLER_FV (pc_value, handler_fv)
|
Argument |
OpenVMS Usage |
Type |
Access |
Mechanism |
pc_value
|
PC value
|
quadword
|
read
|
by reference
|
handler_fv
|
address
|
quadword
|
write
|
by reference
|
Arguments:
|
pc_value
Address of a location that contains the PC value.
pc_value is used to find the unwind information block
and the unwind information block condition handler pointer.
|
|
handler_fv
A quadword to receive the function value of the procedure
descriptor for the condition handler, if there is one.
|
Function Value Returned:
|
status
A value of 1 indicates success.
A value of 0 indicates failure.
|
4.8.4.9 LIB$I64_IS_EXC_DISPATCH_FRAME
Used to determine whether a given PC value represents an exception
dispatch frame.
LIB$I64_IS_EXC_DISPATCH_FRAME (pc_value)
|
Argument |
OpenVMS Usage |
Type |
Access |
Mechanism |
pc_value
|
PC value
|
quadword
|
read
|
by reference
|
Arguments:
|
pc_value
Address of a quadword that contains the PC value.
The
pc_value is used to find the operating system-specific
data area in the unwind information for this routine.
|
Function Value Returned:
|
status
Returns 1 if the operating system-specific data area is present
and the EXCEPTION_FRAME flag is set.
Returns 0 if the operating system-specific data area is present
and the EXCEPTION_FRAME flag is clear. Returns 0 if the operating
system-specific data area is not present.
|
4.8.4.10 LIB$I64_IS_AST_DISPATCH_FRAME
Used to determine whether a given PC value represents an AST dispatch
frame.
LIB$I64_IS_AST_DISPATCH_FRAME (pc_value)
|
Argument |
OpenVMS Usage |
Type |
Access |
Mechanism |
pc_value
|
PC value
|
quadword
|
read
|
by reference
|
Arguments:
|
pc_value
Address of a quadword that contains the PC value.
The
pc_value is used to find the operating system-specific
data area in the unwind information block for this routine.
|
Function Value Returned:
|
status
Returns 1 if the operating system-specific data area is present
and the EXCEPTION_FRAME flag is set.
Returns 0 if the operating system-specific data area is present
and the EXCEPTION_FRAME flag is clear. Returns 0 if the operating
system-specific data area is not present.
|
4.8.5 Invocation Context Callback Routines
Advanced users can override the way the call stack is traced by
providing custom callback routines. These routines can be used to
perform the following functions:
- Perform a call trace on a process other than the current process.
- Override the heap storage mechanism used to allocate memory used
during the analysis of unwind descriptors.
The user override callback mechanism provides a
user ident value that is passed to each callback
routine. The user ident value is stored in the LIBICB$IH_UO_IDENT field
of the invocation context block.
The routines described in this section must be provided to override the
call stack walk.
Note
The callback routines cannot be used with the following routines, which
are not passed a context block:
- LIB$I64_GET_CURR_INVO_HANDLE
- LIB$I64_GET_PREV_INVO_HANDLE
|
4.8.5.1 The Get Unwind Information Routine
Place a function pointer for this routine in the LIBICB$PH_UO_GETUEINFO
field of the invocation context block.
int (* getueinfo) (uint64 pc, void *get_ue_block, void *name, ...);
|
This routine should mimic SYS$GET_UNWIND_ENTRY_INFO for the target
process. See Section A.6 for detailed argument descriptions and
return status, with the following notes:
The name argument is not used, and can be ignored. If a read memory
callback has been specified, the contents of LIBICB$PH_UO_READ_MEM are
passed as a fourth argument, and the contents of LIBICB$PH_UO_IDENT are
passed as a fifth argument, otherwise the routine is called with three
arguments.
4.8.5.2 The Get Initial Context Routine
Place a function pointer for this routine in the
LIBICB$PH_UO_GETCONTEXT field of the invocation context block.
The get initial context routine is used to seed the
invocation context block from the target process. This routine should
initialize the invocation context block structure with
the preserved general, floating, branch, and predicate registers, as
well as Application Registers such as AR.RSC, AR.BSP, and AR.PFS from
the target process. This routine should set the valid bits
corresponding to the saved registers in the VALID fields. This routine
must store the original spill address corresponding to R0 in the
ORIGINAL_SPILL_ADDR field. This callback routine is used by
LIB$I64_GET_CURR_INVO_CONTEXT and should be followed by at least one
call to LIB$I64_GET_PREV_INVO_CONTEXT to generate a working context.
int (* getcontext) (void *invo_context, uint64 ident);
|
Argument |
OpenVMS Usage |
Type |
Access |
Mechanism |
invo_context
|
invo_context_blk
|
structure
|
modify
|
by reference
|
ident
|
user_value
|
quadword
|
read
|
by value
|
Arguments:
|
invo_context
The address of the invocation context block.
|
|
ident
Specifies a user ident value from the invocation context block.
|
Function Value Returned:
|
status
A value of 1 indicates success.
A value of 0 indicates failure.
|
4.8.5.3 The Read Memory Routine
Place a function pointer for this routine in the LIBICB$PH_UO_READ_MEM
field of the invocation context block.
The read memory routine is used to transfer data from the target
process.
int (* read_mem) (void *dst, uint64 src, size_t length, uint64 ident);
|
Argument |
OpenVMS Usage |
Type |
Access |
Mechanism |
dst
|
memory_access
|
byte_array
|
write
|
by reference
|
src
|
memory_address
|
quadword
|
read
|
by value
|
length
|
size_t
|
longword
|
read
|
by value
|
ident
|
user_value
|
quadword
|
read
|
by value
|
Arguments:
|
dst
A local memory address and the destination for the read operation.
|
|
src
An address in the target process to be read.
|
|
length
The length in bytes to be read.
|
|
ident
Specifies a user ident value from the invocation context block.
|
Function Value Returned:
|
status
A value of 1 indicates success.
A value of 0 indicates failure.
|
4.8.5.4 The Write Memory Routine
Place a function pointer for this routine in the LIBICB$PH_UO_WRITE_MEM
field of the invocation context block.
The write memory routine is used to transfer data to the target
process. It is used by LIB$I64_PUT_INVO_REGISTERS for a register that
has been saved in memory.
int (* write_mem) (void *src, uint64 dst, size_t length, uint64 ident);
|
Argument |
OpenVMS Usage |
Type |
Access |
Mechanism |
src
|
memory_access
|
byte_array
|
read
|
by value
|
dst
|
memory_address
|
quadword
|
write
|
by reference
|
length
|
size_t
|
longword
|
read
|
by value
|
ident
|
user_value
|
quadword
|
read
|
by value
|
Arguments:
|
src
A local memory address and the source for the write operation.
|
|
dst
An address in the target process to be written.
|
|
length
The length in bytes to be written.
|
|
ident
Specifies a user ident value from the invocation context block.
|
Function Value Returned:
|
status
A value of 1 indicates success.
A value of 0 indicates failure.
|
|