HPlogo System Debug Reference Manual > Chapter 3 System Debug Interface Commands and Intrinsics

SETDUMP Intrinsic

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

Arms the Debug call that is made during abnormal process termination.

Callable from: NM, CM

Syntax



   SETDUMP (flags );

Parameters


flags

16-bit unsigned integer (required)

This parameter is provided for compatibility with MPE V. It is required, but is ignored.

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/iX Intrinsics Reference Manual for additional discussion of this intrinsic.

Condition Codes


CCE

Request granted.

CCG

Abnormal process termination. Debug call is already enabled and remains enabled.

CCL

Not returned by 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.




RESETDUMP Intrinsic


STACKDUMP Intrinsic