HPDEBUG intrinsic [ System Debug Reference Manual ] MPE/iX 5.0 Documentation
System Debug Reference Manual
HPDEBUG intrinsic
Enters Debug and optionally executes a specified set of system Debug
commands.
Callable from: NM
Syntax
HPDEBUG (status, cmdstr [,itemnum, item] [...]);
Parameters
status 32-bit signed integer by reference (optional)
The status returned by the HPDEBUG intrinsic call. The
variable is a record containing two 16-bit fields, with
the error number in the high-order 16 bits and the
intrinsic subsystem number in the low-order 16 bits.
cmdstr character array (optional)
A packed array of characters from 255 to 1024 bytes that
contains the Debug commands to be executed. The first
character in the array is recognized as the command
delimiter. The last character in the command string
must be followed immediately by the same delimiter.
itemnum 32-bit signed integer by value (optional)
The item number of an HPDEBUG option as defined in the
following HPDEBUG options.
item type varies by value (optional)
Passes and/or returns the HPDEBUG option indicated by
the corresponding itemnum parameter. The itemnum/item
optional parameters must appear in pairs. You can
specify any number of option pairs. Any itemnum takes
precedence over any previously specified duplicate
itemnum. The following discussion lists the optional
itemnum/item parameter pairs available to you.
itemnum=1 Output file number (I32)
Passes an item value specifying an opened
file number to which DEBUG output is sent.
The file must be a writeable ASCII file.
The item value 1 is valid and specifies that
$STDLIST will be used. Default: Use
terminal LDEV for sessions and $STDLIST for
jobs.
itemnum=2 Welcome Banner Flag (I32)
Passes an item value indicating if the Debug
welcome banner should be printed. An item
value of zero (0) keeps the banner from
printing. Any other value causes the banner
to print. Default: Print the welcome
banner (1).
Discussion
The HPDEBUG intrinsic calls Debug with an optional character array
containing Debug commands. If the command list is specified, Debug
pushes the commands onto its command stack and executes them.
If no command in the command string causes control to be returned to the
calling procedure (that is, a CONTINUE command), the user is left in
Debug as long as the process is being run from a session environment.
Processes run from a job are not allowed to stop in Debug. If the
command string does cause control to return to the calling procedure, any
remaining commands are left pending on Debug's command stack to be
executed the next time Debug is called.
Refer to the MPE XL Intrinsics Reference Manual (32650-90028) for
additional discussion of this intrinsic.
Condition Codes
This intrinsic does not return meaningful condition code values. Status
information is returned in the optional status parameter described above.
Example
The following example is an excerpt from a Pascal program which
illustrates a call to the HPDEBUG intrinsic. The commands passed to
Debug produce output similar to that of the STACKDUMP intrinsic. The
command string contains commands that tell Debug to first open a list
file, print a title, produce a stack trace, and finally close the list
file and return to the calling routine.
PROCEDURE call_hpdebug;
VAR debug_cmds : string[255];:
status : integer;
procedure HPDEBUG; intrinsic;
BEGIN
debug_cmds := '\list myfile;wl "***STACKDUMP***";tr,dual;list close;c\';
hpdebug(status, debug_cmds);
IF (status <> 0) THEN
error_routine(status, 'HPDEBUG');
END;
MPE/iX 5.0 Documentation