Use the Variables view to work with the contents of local, file static, and global variables in your program.
Figure 11-47 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 or remove variables by selecting one or more variables. 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 specific 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 ta to view variables with the text
tain their name. Double-click the variable to add it to the Variables view.
- Browse and select multiple variables
If you want to view all the available variables in your code, click Browse 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.
- 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 to remove the selected variables. If you want to reset the view to display the default variables again, then from the view menu, select Reset to default.
Tip:You can also use the Delete key on your keyboard to delete the variables.
- 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
Tip:You 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 the button to change all numeric values to hexadecimal values. This works as a toggle and your preference is saved across sessions.
- Modify the value of write access variables
- You can modify the values of variables with 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.
Toolbar and context menu options
The following options are available from the toolbar or context menu:
Links this view to the selected connection in the Debug Control view. This is the default. Alternatively you can link the view to a different connection. If the connection you want is not shown in the drop-down list you might have to select it first in the Debug Control view.
Copies the selected variables. To copy the contents of an item such as a structure or an array, you must first expand that item.
This can be useful if you want to copy variables to a text editor in order to compare the values when execution stops at another location.
- Select All
Selects all variables currently expanded in the view.
- Show in Memory
Where enabled, displays the Memory view with the address set to either:
The value of the selected variable, if the variable translates to an address, for example the address of an array,
The location of the variable, for example the name of an array,
The memory size is set to the size of the variable, using the
- Show in Disassembly
- Where enabled, displays the Disassembly view, with the address set to the location of the selected variable.
- Show in Registers
If the selected variable is currently held in a register, displays the Registers view with that register selected.
- Show Dereference in Memory
If the selected variable is a pointer, displays the Memory view with the address set to the value of the variable.
- Show Dereference in Disassembly
- If the selected variable is a pointer, displays the Disassembly view, with the address set to the value of the variable.
- Translate Variable Address
Displays the MMU view and translates the address of the variable.
- Toggle Watchpoint
- Displays the Add Watchpoint dialog to set a watchpoint on the selected variable, or removes the watchpoint if one has been set.
- Enable Watchpoint
- Enables the watchpoint, if a watchpoint has been set on the selected variable.
- Disable Watchpoint
- Disables the watchpoint, if a watchpoint has been set on the selected variable.
- Resolve Watchpoint
- If a watchpoint has been set on the selected variable, re-evaluates the address of the watchpoint. If the address can be resolved the watchpoint is set, otherwise it remains pending.
- Watchpoint Properties
- Displays the Watchpoint Properties dialog box. This enables you to control watchpoint activation.
- Send to <selection>
Enables you to add variable filters to an Expressions view. Displays a sub menu that enables you to specify an Expressions view.
- <Format list>
A list of formats you can use for the variable value.
- View Menu
The following View Menu options are available:
- New Variables View
Displays a new instance of the Variables view.
- Update View When Hidden
Enables the updating of the view when it is hidden behind other views. By default, this view does not update when hidden.
- Reset to default variables
Resets the view to show only the default variables.
- Freeze Data
Toggles the freezing of data in the current view. You cannot modify the value of a variable if the data is frozen. This option also disables or enables the Refresh option.
If you freeze the data before you expand an item for the first time, for example an array, the view might show
Pending.... Unfreeze the data to expand the item.
- Editing context menu options
The following options are available on the context menu when you select a variable value for editing:
Reverts the last change you made to the selected value.
Copies and deletes the selected value.
Copies the selected value.
Pastes a value that you have previously cut or copied into the selected variable value.
Deletes the selected value.
- Select All
- Selects the value.
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.