You can examine any of the variables in you program when you pause the program and switch to debug mode. If a variable contains an incorrect value, you can change the value and then continue running your program with the new value in place.
You can evaluate a variable directly in the Source Editor by moving the mouse over the variable. The value of the variable is display in a tool tip.You can also examine variables in the following views of the Debugger window.
View | Description |
---|---|
Variables | Lists the variables that are active in the current context. |
Watches | Lists the variables that you elected to watch. A watch is evaluated when program execution stops and the watch is in the scope of the current method on the call stack. |
Threads | Lists the thread groups in the progress being debugged and the variables in any currently running thread. | Call Stack | Lists the methods on the call stack and any variables in those methods. |
Classes | Lists the classes that have been loaded by the process being debugged and any static variables in the classes. |
In the Debugger window, the debugger attaches a pound sign (#) and a number to each object. This number is unique identifier of the given instance. You can use this identifier to check if a variable points to the same or to a different instance.
You can modify a variable from the Variables view, Watches view, Threads view, or Call Stack view.
For step-by-step instructions, see:
Modifying the Value of a Variable
Watching the Value of a Variable or Expression
Creating a Fixed Watch
Deleting a Watch