Arms the Debug call that is made during abnormal process termination.
Discussion |
 |
The SETDUMP intrinsic arms a call to Debug which is made
during abnormal process terminations (aborts). If the process aborts,
Debug is called with a command string that results in a full
stack trace of both the CM and NM data stacks along with a dump of the native
mode registers. This output is sent
to the standard list device ($STDLIST).
This intrinsic affects the current process, child process, and any generation
grandchild processes subsequently
created by the calling process. That is, the Setdump attribute and the
default cmdstr are inherited by any new child process and all
generations thereafter.
If the process that aborts is being run from a job, the process terminates
after the stack trace and register dump are performed.
If the process is being run from a session, after the stack trace and register
dump have been completed,
Debug stops to accept interactive commands with I/O
performed at the user terminal, contingent upon the following requirements:
The abort did not occur while in system code, and
The process entered the abort code through a native mode interrupt. Such aborts are typically caused by arithmetic and code-related traps (see the XARITRAP and XCODETRAP intrinsics).
 |
 |  |
 |
 | NOTE: CM programs usually fail these tests. |
 |
 |  |
 |
Once Debug accepts interactive input, the user is free to
enter any Debug command. The user may choose to resume the process or have it
terminate (refer to the CONTINUE command in chapter 4).
If the cause of the abort is a stack overflow, the command list is
ignored and a stack trace is sent to
$STDLIST, after which the process
terminates. No interactive debugging is allowed.
Refer to the HPSETDUMP intrinsic for a more flexible version of this intrinsic.
Refer to the MPE XL Intrinsics Reference Manual (32650-90028) for additional
discussion of this intrinsic.
Examples |
 |
The following example is a code fragment from a Pascal program. It declares
SETDUMP as an intrinsic and then calls it. The rest of the
code in the program is protected by the Setdump facility, unless another
routine in the program explicitly turns it off.
PROGRAM myprog;
TYPE bit16 = 0 .. 65535;
flags : bit16;
procedure SETDUMP; intrinsic;
BEGIN
SETDUMP( flags );
.
. <the rest of the program follows>
.
END.
|