System Debug Reference Manual (32650-90888)
306 Chapter7
Symbolic Formatting Symbolic Access
Using the Symbolic Formatter
$nmdebug > fv addr1 "StudentRecord.Year"
SENIOR
$nmdebug > fv dp+8 "Person.sex"
FEMALE
The above examples show how any field within a record may be formatted. Note that the
address supplied is always the address for the beginning of the record, not the address of
the field of interest.
As with field selection, array elements can also be selected. The command
$nmdebug > fv addr1 "StudentRecord.Grades[3]"
4e
displays only the third element of the field grades within the record StudentRecord.
As we saw in the person example above, if a data structure contains a pointer, its value
(that is, the address of the pointed-to structure) is displayed. If the target of the pointer is
desired, the caret (^) is used to indicate dereferencing. Consider the following examples:
$nmdebug > fv dp+8 "person.next"
40200024
$nmdebug > fv dp+8 "person.next^"
RECORD
NEXT : 40200300
NAME : 'Mr. Jones'
SEX : MALE
MS : SINGLE
LOOKING : TRUE
END
$nmdebug > fv dp+8 "person.next^.next^.next^.next^.name"
'Mrs. Robinson'
If you try to dereference a field which contains a nil or invalid pointer, an error message is
generated and the formatter stops formatting.
For variant records in which the tag fields are not stored, the variants to be used when
formatting them may be specified by including tag field values. If no field is supplied, the
first variant of the structure is assumed. The following examples are based on these types:
bit8 = 0 .. 255;
CoerceRec = RECORD
CASE integer OF
0 : (int : integer);
1 : (ch : PACKED ARRAY [1..4] OF char);
2 : (byte : PACKED ARRAY [1..4] OF bit8);
3 : (bool : PACKED ARRAY [1..32] OF boolean);
END;
Consider the following examples assuming that the System Debug variable addr contains
the address of some data corresponding to a CoerceRec data structure:
$nmdat > FV addr2 "CoerceRec"