Debugging: Variables Window

See Also

The Variables window lists the local variables in the current call. By default, the Variables window opens automatically whenever you start a debugging session. You can open the Variables window by choosing Window > Debugging > Variables.

If you open the Variables window when a debugging session is running, it closes automatically when you end the debugging session. If you open the window when no debugging session is running, it stays open until you close it.

The information given for each variable includes the variable name, type, and value. You can click the control to the left of the name to expand or collapse the variable. If the object type is displayed in blue underlined text, clicking the text jumps to the object type in the source code. You can click the Value cell to edit the value directly in the Variables window.

In some cases, the debugger assigns a pound sign (#) and a number as the variable's value. This number is a unique identifier of the given instance. You can use this identifier to determine if a variable points to the same or to a different instance. You cannot edit this value.

Icons

The following table describes the icons displayed to the left of the object name.

Icon Description
Local variable icon Local variable
Super variable icon Container for a superclass
Static field icon Static field of an object
Non-Static field icon Non-static field of an object
Return values history icon The return values of executed methods when using expression step.
Arguments to expression step icon Input values for next method when using expression step.

Actions

If you right-click inside the Variables window, the pop-up menu displays the following choices:

Menu Item Description
Create Fixed Watch Creates a fixed watch of the selected object. A fixed watch displays the specified object or memory location regardless of the current context.
Display As For objects of type integer only. Determines how the value of the selected object is shown. The choices are decimal, hexadecimal, octal, and binary.
Go to Source Opens the source file containing the variable.
Show References Opens the Instance view showing list of instances and the referrers (not available if IDE is running on JDK 1.5). See Instances Window for more information.
List Options Enables you to customize the display of the Variables window, including adding and removing columns of information, reordering the columns, and sorting the columns. See Customizing a Debugger Window for more information.

Properties

By default, all properties are displayed directly in the Variables window, except for the toString() property. To display the toString() property in the Variables window, click the Change Column icon in the upper right corner of the window, or right-click in the window and choose List Options > Change Visible Columns and then select the toString() checkbox in the dialog box.

See Also
Current Context in the Debugger
Debugging Tasks: Quick Reference
Variables and Expressions in the IDE
Creating a Fixed Watch
Debugger Windows

Legal Notices