Use the Variables view to work with the contents of local, file static, and global variables in your program.
Figure 15-51 Variables view
- View the contents of variables that are currently in scope
By default, the Variables view displays all the local variables. It also displays the file static and global variable folder nodes. You can add and remove variables from the view. Keep the set of variables in the view to a minimum to maintain good debug performance.
- Add a specific variable to the Variables view
If you know the name of the variable you want to view, enter the variable name in the Add Variable field. This lists the variables that match the text you entered. For example, enter the text
nuto view variables with
nuin their name. Double-click the variable to add it to the view.
Figure 15-52 How to add variables to the view
- Add one or more variables
If you want to view all the available variables in your code, click Add to display the Add Variable dialog. Expand the required folders and filenames to see the variables they contain. Then select one or more variables that you are interested in and click OK to add them to the Variables view. Ctrl+A selects all the variables that are visible in the dialog. Selecting a filename or folder does not automatically select its variables.
Figure 15-53 Add Global Variables dialog
- Delete variables
You can remove the variables that you added from the variables view. In the Variables view, select the variables you want to remove from the view, and click , or press Delete on your keyboard, to remove the selected variables. If you want to reset the view to display the default variables again, then from the view menu, select .
- Search for a specific variable
You can use the search feature in the Variables view to search for a specific variable in view.
If you know the name of the specific variable, click to display the Search Variables dialog box. Either enter the name of the variable you want or select it from the list.
Press Enter on your keyboard, or double-click the variable to select and view it in the Variables view.
NoteYou can also use CTRL+F on your keyboard to display the Search Variables dialog box.
- Refresh view
To refresh or update the values in the view, click .
- Toggle between numerical and hexadecimal values
Click to change all numeric values to hexadecimal values. This works as a toggle and your preference is saved across sessions.
- Modify the value of variables
You can modify the values of variables that have write access, by clicking in the Value column for the variable and entering a new value. Enable the Access column to view access rights for each variable.
- Freeze the view to prevent the values being updated by a running target
Select Freeze Data from the view menu to prevent values updating automatically when the view refreshes.
- Drag and drop a variable from the Variables view to other views
Drag and drop a variable from this view into either the Memory view to see the memory at that address, or into the Disassembly view to disassemble from that address.
Adding a new column header
Right-click on the column headers to select the columns that you want to display:
The name of the variable.
The value of the variable.
Read-only values are displayed with a gray background. A value that you can edit is initially shown with a white background. A yellow background indicates that the value has changed. This might result from you either performing a debug action such as stepping or by you editing the value directly.
NoteIf you freeze the view, then you cannot change a value.
The type of the variable.
The number of array or pointer elements.
The size of the variable in bits.
The address of the variable.
The access mode for the variable.
- Show All Columns
Displays all columns.
- Reset Columns
Resets the columns displayed and their widths to the default.