Guardian Programmer's Guide

Table Of Contents
Debugging, Trap Handling, and Signal Handling
Guardian Programmer’s Guide 421922-014
25 - 20
Handling Signals
! One or more sequences like the following
! surround code that might trap.
IF TRAP_GUARD THEN ! TRAP_GUARD will later return True
BEGIN ! to execute this THEN clause, if a
! trap occurs in the ELSE clause.
.
. ! code to handle the trap contingency
.
END
ELSE ! TRAP_GUARD initially returns False
BEGIN ! to execute this ELSE clause.
.
. ! code that might trap
.
END;
CALL ARMTRAP(-1,-1); ! Abend if trap where unexpected
! (Note that if the procedure that called TRAP_GUARD were
! to exit, and a trap occurred while traps were still
! armed, the saved destination would be wrong.)
.
. ! code where no trap is tolerated
.
Handling Signals
Native Guardian processes receive signals when run-time events occur that require
immediate attention; they cannot receive traps. (OSS processes, both TNS and
native, receive signals.) Signals are software interrupts that provide a way of handling
asynchronous events, such as a timer expiration, detection of a hardware fault,
abnormal termination of a process, a lack of system resources, a process sending a
signal to itself, or any trap condition normally detectable by a TNS process.
The signals facility is unchanged in the H-series. However, the H-series signals facility
uses the H-series debuggers, as shown in the following table:
See the Inspect Manual, the Native Inspect Manual, and the Visual Inspect online help
for details.
Programs running as native Guardian processes can use the following functions and
procedures to receive and handle signals:
CPU and Execution
Mode
Debuggers
TNS/R native mode
Visual Inspect, Inspect, Debug
TNS/E native mode Visual Inspect, Native Inspect
The details mentioned for H-series are also applicable to J-series RVUs.