|
|
System Debug Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 System Debug Interface Commands and IntrinsicsDebug Interfaces |
|
Debug may be invoked directly or indirectly: directly from the CI of a session, or from an intrinsic call within a program; indirectly through arming a call to Debug in the case of a process abort. The MPE XL CI commands are identical to the MPE V commands, with the exception that the user may specify an optional command string to be passed to Debug when it is invoked. The following is a list of the available MPE XL CI commands and their syntax:
All intrinsics can be called from NM with the exception of STACKDUMP'. This intrinsic is not supported in native mode and is found only in the CM intrinsic file. Only those intrinsics available in MPE V are callable by the CM user. The following table summarizes which intrinsics are callable from compatibility mode (CM) and native mode (NM):
Note that no HPSTACKDUMP intrinsic is present. It is intended that the user call HPDEBUG to produce a custom stackdump when desired. If you want to invoke Debug from the CI of the current session, use the DEBUG command. This command is implemented through intrinsics. The CI simply calls the DEBUG or HPDEBUG intrinsic. Note that this command requires privileged mode (PM) capability.
The following example shows a call to Debug with a command to display the registers and then return to the CI.
Debug may also be invoked with the HPDEBUG/DEBUG intrinsic calls from within any program. Native mode programs enter Debug assuming that the user will be viewing the native mode environment (program, stack, registers); this is referred to as NM Debug. Compatibility mode programs enter Debug assuming that the user will be viewing the compatibility mode environment; this is called CM Debug. You may arm a call to Debug which occurs in the event of a process abort. The call may be armed by:
Once a SETDUMP command or intrinsic has been issued, all new processes created are affected. Both the setdump attribute and the DEBUG command string are inherited by new child processes. This feature may be disarmed by the following:
If the Debug process abort call has not been armed through one of the SETDUMP interfaces, and a process abort occurs, an abbreviated stack trace is produced. This abbreviated trace shows only the most recently called procedure in the program file and in each library being used. This is done for both the CM and NM stacks. The following is an example of a CM program aborting without invocation of SETDUMP.
The following example is the same as above except that the code was compiled with a native mode compiler.
If the SETDUMP command (or intrinsic) is invoked before running this program, a full dual stack trace and a register dump is produced when the process aborts. Consider the following example:
Note that in the above example, the user is left in Debug. At this point, the user is able to enter any Debug command. The process may even be resumed (see the CONTINUE command in chapter 4). It is possible to specify what action should be taken when a process aborts by providing a list of commands for Debug to execute. In the following example, a simple message is printed if the process aborts.
Notice that the user was not left in Debug after the command string was executed. In order to be left in Debug, several criteria must first be met:
Most CM programs fail these checks and are returned to the CI without entering Debug. The SETDUMP functionality is also accessible programmatically with the SETDUMP and HPSETDUMP intrinsics. Refer to the following pages for detailed descriptions and examples. |
|