System Debug Reference Manual (32650-90888)

Chapter 7 297
Symbolic Formatting Symbolic Access
7 Symbolic Formatting Symbolic Access
Most of the time spent in the debugging of programs and the analysis of system dumps is
in the interpretation of data found in memory images. The symbolic formatter provides a
powerful and efficient way of referencing this data symbolically and displaying it using its
declared type(s). Regardless of the source language, all data are formatted using a
Pascal-style syntax.
Most examples used in this section are based upon the following types:
CONST MINGRADES = 1; MAXGRADES = 10;
MINSTUDENTS = 1; MAXSTUDENTS = 5;
TYPE
GradeRange = MINGRADES .. MAXGRADES;
GradesArray = ARRAY [ GradeRange ] OF integer;
Class = ( SENIOR, JUNIOR, SOPHOMORE, FRESHMAN );
NameStr = string[8];
StudentRecord = RECORD
Name : NameStr;
Id : integer;
Year : Class;
NumGrades : GradeRange;
Grades : GradesArray;
END;
TYPE Subjects = (ENGLISH, MATH, HISTORY, HEALTH, PHYSED, SCIENCE);
SubjectSet = SET of subjects;
TYPE MStype = (MARRIED, DIVORCED, SINGLE, WIDOWED);
PersonPtr = ^Person;
Person = RECORD
Next : PersonPtr;
Name : string[16];
Sex : (MALE, FEMALE);
CASE ms : MStype OF
MARRIED : (NumKids : integer);
DIVORCED : (HowLong : integer);
SINGLE : (Looking : boolean);
WIDOWED : ();
END;
The following examples assume the System Debug variable addr1 contains the virtual
address of a data structure corresponding to the type StudentArray.
A hexadecimal display of that area of memory would be produced by the following:
$nmdebug > dv addr1,10
$ VIRT 7b8.40200010 $ 00000004 42696c6c 00000000 00000000
$ VIRT 7b8.40200020 $ 00000001 00040000 0000002d 00000041
$ VIRT 7b8.40200030 $ 0000004e 00000042 00000000 00000000