Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (A-B)
Guardian Procedure Calls Reference Manual522629-013
2-35
ARMTRAP Procedure
(Superseded by SIGACTION_INIT_ Procedure )
Parameters
traphandlr-addr input
INT:value
is a label (nonzero P register value) that identifies a statement in the program
where control is to transfer if a trap occurs.
You can specify 0 for
traphandlr-addr only in a call from within a trap handler.
Such a call causes the process to resume. See “Considerations” for details.
trapstack-addr input
INT:value
is an address specifying the local data area for the application process’s trap
handler. The
trapstack-addr parameter also indicates where the trap number
and stack marker at the time of the trap are passed to the application process.
If
trapstack-addr has a value < 0, then trap handling is disabled and any trap
results in the process being stopped with a process deletion (ABEND) message.
ARMTRAP Functions
Use the ARMTRAP procedure to perform one of these functions:
Arm a trap handler (that is, specify a location in the application program where
execution begins if a trap occurs). To do this, set
traphandlr-addr to a value
greater than 1 specifying the address of a label at which the trap handler starts and
set
trapstack-addr to a nonnegative value specifying the stack address above
which its activation record will go.
Set default handling (that is terminate, but enter the debugger if in a debug
session). To do this, set
traphandlr-addr to one and set trapstack-addr to zero.
Set traps to enter the debugger. To do this, set traphandlr-addr to one and
trapstack-addr to a value greater than zero. By convention, both parameters are
normally set to 1 in such as call.
Disarm all trap handling (that is, specify that no part of the application program is to
execute if a trap occurs). To do this, set
traphandlr-addr to a nonzero value
and set
trapstack-addr to a negative value. By convention, both parameters
are normally set to -1 in such a call.
Resume the process and rearm the trap handler. This must be done by a call to
ARMTRAP from within a trap handler with
traphandlr-addr set to 0 and
trapstack-addr set to a nonnegative value specifying the stack address above
which its activation record will go. See “Considerations” for details.