| |||
| Home > ARM Debuggers for Windows and UNIX > Debugger further details > Working with variables | |||
To display a list of local or global variables, select the appropriate item from the View menu. A Locals/Globals window is displayed. You can also display the value of a single variable, or you can display additional variable information from the Locals/Globals window.
Follow these steps to display the value of a single variable:
Select View ? Variables ? Expression.
Enter the name of the variable in the View Expression dialog.
Click OK. The variable and its value are displayed in the Expression window.
Alternatively:
Highlight the name of the variable.
Select View ? Variables ? Immediate Evaluation, or click

the Evaluate Expression button. The value of the variable is displayed in a message box and in the Command window.
If you select a local variable that is not in the current context, an error message is displayed.
If the currently active window is the Locals, Globals, Expressions, or Debugger Internals window, you can change the format of a variable.
Follow these steps to change the format of a variable:
Right click on the variable and select the Change line format from the Locals or Globals window menu. The Display Format dialog is displayed.
Enter the display format. Use the same syntax as
a printf() format string in C. Table 3.2 lists the valid
format descriptors.
Click OK.
Table 3.2. Display formats
Type | Format | Description |
| Only use this if the expression being printed yields an integer: | |
| Signed decimal integer (default for integers) | |
| Unsigned integer | |
| Hexadecimal (lowercase letters) | |
| Only use this if the expression being printed yields a char: | |
| Character | |
|
| Pointer to character. Only use this for expressions that yield a pointer to a null terminated string. |
|
| Pointer (same as |
| Only use this for floating-point results: | |
| Exponent notation, for example, | |
| Fixed-point notation, for example, | |
| General floating-point notation, for
example, | |
If you change a single line, that line is not affected by global changes.
Leave the Display Format dialog empty and click OK to restore the default display format. Use this method to revert a line format change to the global format.
The initial display format of a variable declared as char[]= is
special. The whole string is displayed, whereas normally arrays
are displayed as ellipses (…). If the format is changed it reverts
to the standard array representation.
If you have a list of variables displayed in a Locals/Globals window, you can display additional information on a variable by selecting Properties from the window-specific menu (see Figure 3.9). To display the window-specific menu, right click on an item. The information is displayed in a dialog.
Select Indirect through item from the Variables menu to display other areas of memory.
If you select a variable of integer type, the value is converted to a pointer. Sign extension is used if applicable, and the memory at that location is displayed. If you select a pointer variable, the memory at the location pointed to is displayed. You cannot select a void pointer for indirection.