System Debug Reference Manual (32650-90888)

70 Chapter3
System Debug Interface Commands and Intrinsics
STACKDUMP' Intrinsic
filename
parameter.
Example
The following example is a code fragment from a Pascal/V program. It is a procedure which
is passed the file number of an already opened file. The procedure then uses the
STACKDUMP' intrinsic to have a stack trace printed to the specified file number. Note the use
of the Pascal $ALIAS$ directive in declaring the intrinsic.
PROCEDURE dump_stack_to_fnum(fnum : shortint);
TYPE bit8 = 0..255;
kludge_record = RECORD
CASE integer OF
0 : (byte_1 : bit8;
byte_2 : bit8);
1 : (pac : packed array[1..2] OF char);
END;
VAR kludge_var : kludge_record;
procedure STACKDUMP_PRIME $alias 'stackdump'''$; intrinsic;
BEGIN
kludge_var.byte_1 := fnum; { This assumes that the value
of FNUM }
{ is no bigger than 8 bits.
This is }
{ a valid assumption.
}
stackdump_prime(kludge_var.pac); { Call STACKDUMP' to produce
the }
{ stack trace.
}
END;