Watches View

The Watches view in the Debugger window lists all variables and expressions that you have elected to watch while debugging. You switch the display of the Watches view by clicking Watches icon in the View toolbar of the Debugger window.

The information given for each watch includes the variable or expression name, type, and value. You can click the turner control to the left of the name to expand or collapse the object. 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 in the Value cell to edit the value directly in the Watches view.

When you add a new variable or expression to the Watches view, the value of the variable or expression is immediately evaluated and displayed. The value of a watch is based on the current context. As you move through your program code, the Watches view is updated to show the value of the watch for that context.

In some cases, the Java 2 debugger assigns a pound sign (#) and a number as the variable's value. This number is an 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
Watches iconWatch object
Fixed watch iconFixed watch object
Super variable icon iconContainer for a superclass
Static field iconStatic field of an object
Non-Static field iconNon-static field of an object

Actions

The contextual menu in the Watches view includes the following items.

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.
Delete Removes the selected object from the Watches View.
List Options Enables you to customize the display of the Watches view, including adding and removing columns of information, reordering the columns, and sorting the columns. See Customizing Debug Views for more information.
Properties Displays the properties of the selected object.
See also
Creating a Watch
Creating a Fixed Watch
Modifying the Value of a Variable
Deleting a Watch

Legal Notices