When a thread has been suspended, the Debugger browser displays all running methods and the variables visible within them.
Select a method in the All Programs/Threads pane. The Visible Variables pane
shows the variables in use. You can change which variables are shown by changing the
selections in the Inspector menu. Variables that themselves contain
fields can be expanded to show the fields by clicking the plus symbol in the tree.
When you select a variable in the Visible Variables pane, its current value (at the exact point in the program where it was suspended) is shown in the Value pane. If you select multiple variables, the values for each are shown in the Value pane. To select multiple variables:
Opening an Inspector
To closely look at one variable that contains fields, select it in the Visible
Variables pane and click the Inspect button in the toolbar. An Inspector window will open,
showing the variable's fields, and their values. This information is the same as the
information in the Debugger browser Visible Variables and Values panes, and you can
select, view, and modify the contents in the same ways.
Modifying Variable Values While the Program is Running
The values of variables can be modified while the thread is suspended. To
modify a variable's value in the Value pane :
Alternatively, you can modify the value right in the source pane. For example, if you have an integer variable called depth that has a current value of 4, and you want to change its value to 6, do the following steps:
The change in variable value is immediately available to the running program. When you resume running, the new value is used.
Example: Modifying a Value While Running a Program
Debugging During the Development Cycle
Suspending, Resuming, and Terminating Threads
Stepping Through Methods
Modifying Code while Debugging
Evaluating Expressions in the Debugger