System Debug Reference Manual (32650-90888)
68 Chapter3
System Debug Interface Commands and Intrinsics
STACKDUMP Intrinsic
Condition Codes
CCE Request granted.
CCG Request denied. An invalid address for the location of the
filename
parameter was detected.
CCL Request denied. File system error occurred during opening or closing of the
file. The specific file system error number is returned in the
idnumber
described above.
Examples
The following example is a code fragment from a Pascal program. First, it prints out the
error status and intrinsic name that were passed as parameters. Next, it calls the
STACKDUMP intrinsic to produce a stack trace. Finally, the process is terminated with a call
to the TERMINATE intrinsic.
PROCEDURE error_routine(status : integer; { error status }
proc : proc_str); { Intrinsic name that
failed }
procedure STACKDUMP; intrinsic;
procedure TERMINATE; intrinsic;
BEGIN
writeln(proc, ' returned error status of ', status);
stackdump;
terminate;
END;
The next example prompts the user for a file name and then calls the STACKDUMP intrinsic
to print a stack trace to the specified file.
PROCEDURE show_stack;
VAR fname : string[80];
procedure STACKDUMP; intrinsic;
BEGIN
prompt('Print stack trace to which file: ');
readln(fname);
fname := fname + ' '; { Add terminator character }
stackdump(fname);
END;