Debug Inspector
The Debug Inspector is the second tab in the Debug Pane that can optionally be shown at the bottom of the Fire/Water Window, and can be called up with the ⌘⇧2 (Fire) or Ctrl+Shift+2 (Water) keyboard shortcut. It provides a quick and convenient way to inspect the contents of variables and memory used by your application.
The Debug Inspector appears in the form of a tree view, separated into two main section, "Locals" and "Watches".
Locals
The "Locals" section is populated automatically by the debugger to show the local variables available for the currently selected Thread and Stack Frame. As you step thru your paused program, or navigate between stack frames in the {Thread Pane](ThreadPane), its content will automatically adjust.
For each local variable, the Debug Inspector will show its name, the type it contains, as well as the value. For complex types such as classes or records/structs, a disclosure triangle will show, and you can expand the tree view item to drill into the details contents of the variable and its fields.
Watches
The "Watches" section, empty by default, can e used to add custom expressions that you want to evaluate frequently. Once expressions are added to the Watches list, they will persist until you remove them.
As you move through debugging your program, certain watches might become valid or invalid, depending on whether the identifiers used in the expression are available in the current scope. Th Debug Inspector will mark invalid watches as such, but always maintain a consistent list.
Watches are stored per Solution, and will persist across debug sessions or restarts of the IDE.
There are several ways to add Watches to the list:
- Right-click the "Watches" node in the Debug Inspector, and choose "Add Watch..." from the context menu.
- Right-click an identifier in the Editor and choose "Add Watch with '...'" from the context menu/
- Right-click an selected text in the Editor and choose "Add Watch with Selection" from the context menu.
- Choose "Debug|Add Watch..." or "Debug|Add Watch from Selection" from the main menu.
You can remove watches by right-clicking them and selecting "Remove Watch" or by choosing "Clear all Watches" from the "Watches" node's context menu or the "Debug" main menu.
Note: do evaluate an expression only once, without setting a watch, you can use the po
command in the Debug Console or, if applicable, simply select the expression in the Editor to see it evaluated inline.