|
|
These routines can be used to resume execution at a specific point if something
unexpected happens. The HP Pascal run-time libraries use these routines to
recover from traps and to execute non-local ESCAPE statements.
C.3.1 The Recover Table
Entries are sorted by ascending address. Each entry is three words long. Its
format is as follows:
struct recover_table_entry {
unsigned TRY_start; /* Starting offset (from sr4) of TRY region.*/
unsigned TRY_end; /* Ending offset (from sr4) of the
instruction following TRY region. */
unsigned RECOVER_start; /* RECOVER block offset for associated
TRY region (execution resumes here). */
};
U_get_recover_table
struct rtable {
unsigned recover_table_start;
unsigned recover_table_end;
};
struct rtable U_get_recover_table(unsigned int dp_value);
Returns the code offsets of the start and end of the recover table of
a given object module. The recover table is word-aligned. It takes
the DP value for the object module where the recover table is stored.
It returns the offset of the start of the recover table, and the
offset of the first word beyond the recover table.
This is the interface for assembly programmers:
ARG0: | DP value of routine associated with PC value of
interest. |
|
RET0: | Offset (in space of routine being unwound to) of start of
recover table. |
|
RET1: | Offset (in space of routine being unwound to) of first
word beyond end of recover table. |
U_get_recover_address
Given the PC_offset value of interest and the location of the
associated recover table, returns the code offset (in PC_space)
of the associated recover block. If the PC_offset does not
point to a try block, -1 is returned.
int U_get_recover_address(
unsigned int PC;
unsigned int Space_id;
unsigned int rtable_start;
unsigned int rtable_end);
This is the interface for assembly programmers:
ARG0: | PC_offset to look up. |
|
ARG1: | Offset (in space of routine being unwound to) of start of
recover table. |
|
ARG2: | Offset (in space of routine being unwound to) of first
word beyond end of recover table. |
|
ARG3: | Space id of recover table. |
|
RET0: | Recover address with actual execution level, or -1 if not
found. |
|