Debugger: Variable Viewer
The Variable Viewer displays a table of local variables for the function at the current
program counter, evaluated against the current thread's machine state at the current snapshot.
Variables are gathered from two sources: the Static Listing and the Decompiler.
The variable viewer uses colors to hint about changes and freshness of displayed values. By
default, changed values are displayed in red, and stale values are displayed in dark gray. A
stale value is one whose backing register or memory location has not been recorded in
the current snap.
Table Columns
The table displays and allows modification of each variable. It has the following
columns:
- Source (hidden by default) - indicates where the variable was discovered. The
value is either the Static
Listing or the Decompiler.
When both sources produce a variable with the same symbol name, only one entry is shown; the
Listing entry takes precedence.
- Storage - the location where the variable's value is stored. For register-backed
variables this shows the register name. For memory-backed variables this shows the address.
If the storage location could not be determined,
?? is shown.
- Symbol - the name of the variable. This field is user-modifiable when Enable Edits is on.
- Value - the raw bytes of the variable's current value. For scalar variables whose
size does not exceed the pointer size, the value is shown as a hexadecimal integer. For
larger variables the bytes are shown as a space-separated hex sequence enclosed in braces.
Very large values are truncated with an ellipsis. This field is user-modifiable when Enable Edits is on and the variable's storage is writable. Edits may be
directed toward a live target, the trace, or the emulator, according to the Control and Machine State
Plugin.
- Type - the data type assigned to the variable. This field is user-modifiable when
Enable Edits is on. The type is used to compute the Repr
column.
- Repr - the value of the variable as interpreted by its assigned data type. This
field is user-modifiable when the Value column is modifiable and the selected data
type provides an encoder. Editing this field encodes the entered representation back to raw
bytes and writes them to the variable's storage location.
- Error - if an error occurs while evaluating the variable (for example, because the
storage location is not accessible at the current snapshot, or the stack frame could not be
unwound), the error message is shown here.
Actions
The variable viewer provides the following actions:
Enable Edits
This toggle enables writes to the machine state. To modify a variable's symbol, value, type,
or representation, this toggle must be enabled. It is available only when there is an active
trace. Edits are directed according to the Control and Machine State
Plugin.
Show/Hide
Variables
This action controls which source of variables is displayed in the table. The three choices
are:
Show Variables From Both - displays
variables gathered from both the Listing and the Decompiler. When both sources produce a
variable with the same symbol name, only one entry is retained.
Show Listing Variables Only -
displays only variables derived from the static listing.
Show Decompiler Variables Only -
displays only variables recovered by the decompiler.
Right Click Actions
- View [variable] @ 0x... in... - This action is available when a single variable is
selected and its storage address is a non-register memory address. It navigates to that
address in a chosen listing window.
- Deref *[variable] @ 0x... in... - This action is available when a single variable
is selected and its current value can be interpreted as a valid memory address (i.e., the
variable is a pointer). It navigates to the dereferenced address in a chosen listing
window.
Sub Menu Options
Both actions share the same sub options of which listing window to show the result in:
- Main Listing - navigates the primary dynamic listing to the variable's storage
address.
- [Additional Listing Windows] - navigates any other open dynamic listing windows to
the variable's storage address.
- New Listing - opens a new dynamic listing window, sets it to follow the current
thread, and navigates it to the variable's storage address.