System Debug Reference Manual (32650-90888)

304 Chapter7
Symbolic Formatting Symbolic Access
Using the Symbolic Formatter
$nmdebug > FT "maxgrades"
INTEGER
$nmdebug > FT "class"
( SENIOR, JUNIOR, SOPHOMORE, FRESHMAN )
Display various types. Notice that path specification is not limited to a simple type or
constant name, but rather it may consist of any composite path specification.
The examples in the following pages include variant records and pointers. The following
set of type declarations is used:
$nmdebug > ft "PersonPtr"
^ PERSON
$nmdebug > ft "PersonPtr^"
RECORD
NEXT: PERSONPTR ;
NAME: STRING[ 10 ];
SEX : ( MALE, FEMALE );
CASE MS: MSTYPE OF
MARRIED : ( NUMKIDS: INTEGER );
DIVORCED: ( HOWLONG: INTEGER );
SINGLE : ( LOOKING: BOOLEAN );
WIDOWED : ( );
END
$nmdebug > ft "PersonPtr^.Sex"
( MALE, FEMALE )
Notice that you can refer to a type with a pointer dereference. That is, "Show me the type
that this pointer points to."
Formatting Data
The FV command allows you to format data at any virtual address using a given data
structure:
format
at_any_virtual_address as_if_it_were_a_specific_type
Before proceeding to some examples, we must deal with the question, "How do I find the
virtual address of the data structure I want to format?" Most language compilers use the
following conventions (as detailed in the Procedure Calling Conventions Manual:
Global data is stored relative to DP (data pointer). DP is an alias for R27.
Procedure local variables are stored relative to SP (stack pointer). SP is an alias for
R30.
Procedure parameters are stored in the argument registers (ARG0-ARG3) and in the
stack relative to PSP (previous stack pointer). PSP is not contained in a register but is a
pseudo-register that is computed by System Debug.