This section discusses the following topics:
Local variables are displayed in the Variables pane of the Thread window (Figure 11.60). If the variable is a handle, pointer, or structure, you can click the hierarchical control to the left of the name to expand the view. This allows you to see the members of the structure, or the data referenced by the pointer or handle.
To learn some useful tips for using hierarchical controls, see "Expanding and Collapsing Groups". For more information about the Variables pane of the Thread window, refer to "Variables pane."
Viewing Local Variables:
To view global variables, open the Global Variables window. Use one of the following techniques:
View > Global Variables Window.
Window > Global Variables Window.
For more information, see "Global Variables Window".
Viewing Global Variables:
To place a variable or memory location in its own window, double-click its name (Figure 11.62) or select the name and choose Data > View Variable, or choose the View Variable command from the debugger contextual menu (Figure 11.18). If the variable is an array, use the View Array command instead. To view the memory the variable occupies as a memory dump, use either the View Memory or View Memory As command.
For more information, see "Variable Window," "Array Window," and "Memory Window".
Placing a Variable in Its Own Window:
If you wish, the debugger can display the data types of variables on a window-by-window basis. Select the window or pane in which you want data types displayed and choose Data > Show Types, or choose the Show Types command from the debugger contextual menu (Figure 11.18). Then, the relevant data type follows the names of the variables and memory locations in that window or pane (Figure 11.63).
TIP
In variable panes, show variable types by default
See "Display Settings" for more information.
Selecting a Data Format:
You display a variable's value in several formats:
Fixed
Fract
1. Select the item in a window or pane.
Alternatively, you can use the debugger contextual menu (Figure 11.18) to select the same command. After you choose the View As menu command, the debugger displays the View As dialog box, shown in Figure 11.65.
3. Select the data type by which to view the item.
The display of the item's value changes to the specified type.
Selecting a Data Type:
You can change the value of a variable in any variable view. Variables are displayed in several debugging windows: the Variables pane of the Thread window or Symbolics window, a Variable window, an Array window, or the Expressions window. To change the value, double-click the variable (or select it and press Enter/Return) and type the new value (Figure 11.66).
You can enter variable values in any of the following formats:
'' for a character constant, double quotes "" for a string). For Pascal strings, include the escape sequence \p as the first character in the string.
WARNING!
nil and crash the machine.
View > Expressions.
Window > Expressions Window.
Data > New Expression.
Data > Copy to Expression.
Copy to Expression command from the debugger contextual menu (Figure 11.18).
Copy to Expression and View As commands in the Data menu and the debugger contextual menu.
For more information, see "Expressions Window".
To examine and change the raw contents of memory:
1. Select an item or expression representing the base address of the memory you want to examine.
The View Memory and View Memory As commands in the Data menu allow you to follow any pointer-including an address stored in a register-and view the memory to which it currently points.
To display the memory referenced by a pointer, follow these steps:
1. Select the value of the variable or register in a window in which it appears.
2. Choose Data > View Memory or Data > View Memory As.
If you choose the View Memory menu command, stop with this step. A Memory window opens and displays a raw memory dump, starting at the address referenced by the pointer.
If you choose the View Memory As menu command, continue to the next step. A dialog box (Figure 11.67) opens and prompts you to select a data type.
3. If you chose Data > View Memory As, select a data type in the View As dialog box.
4. Click OK in the View As dialog box.
A new window opens (Figure 11.68) and displays the contents of memory, starting at the address referenced by the pointer.
Choosing a Data Type to View Memory:
NOTE
For more information, refer to "Memory Window".
Viewing Memory as a Specified Data Type:
To view the contents of the processor's general registers, choose Window > Registers Windows > General Registers (Figure 11.69).
For more information, see "Register Windows".
Viewing General Processor Registers: