Watch Panels
The Watch Panels are two separate panels in the top-level Main Window.
A watch is a variable name or expression to evaluate the value of when the target JVM is suspended,
for example after a step.
The following are valid expressions that the debugger can watch:
- Local variables in the current scope.
- Object (This) fields in the current scope.
- objectRef.fieldName where objectRef is in the current
scope (fieldName can be a private field).
- arrayRef[i] or arrayRef[2] where arrayRef
and i are in the current scope.
- fullPackageName.className.staticField where className
has been loaded into the target JVM.
If an expression can not be evaluated, then
"(could not evaluate)" is displayed in green.
Watches are organized by Watch Panels. The debugger contains two Watch Panels:
- Watch Panel 1.
- Watch Panel 2.
A Watch Panel displays a table of watches.
table
Each row in the table represents a watch. Each watch has the following attributes
(which are the columns of the table). [Shift] Click on a column header to sort the table in
[descending] ascending order according to that column.
- Expression - the variable name or expression to watch. Simple variable
names are displayed in blue. Array accesses are displayed in green. Object field accesses
are displayed in purple.
- Value - the current value of the watch. Changed values are
displayed in red. If the value is a non-null reference, then the corresponding
object ID will be displayed in blue. If the value is
a null reference, then "null" will be displayed in blue.
Strings and characters are displayed in magenta.
- Type - the variable's or expression's type. Standard Java types are displayed in blue.
To change a value of a primitive variable (boolean, byte, short, int, long, character, float, double),
double click on the corresponding value cell and enter the new value followed by hitting
the Enter key (or hit the Escape key to cancel the editing).
The new value string must validate in order for the change to be made.
A Tool Tip is displayable for each watch row in the table.
For object references, the Tool Tip displays the object's fields in the
inheritance hierarchy. For array references, the Tool Tip displays the
beginning array elements. For string references, the Tool Tip displays the
beginning string characters. The number of lines displayed in a Tool Tip
is configurable in the Global Settings Dialog.
While the target JVM is running, an hour glass cursor will be displayed in the Watch Panels.
context menu
A popup Context Menu is displayed by right clicking on the table:
- Inspect... - displays the selected (watch)
non-null object reference
in the Object Panel or the selected non-null array reference in the
Array Panel
in the top-level Objects Window.
Strings are displayed in the String Panel
in the top-level String/To String Window.
This can also be accomplished by double clicking
on a watch table row.
- To String... - invokes the toString() method on the selected (watch)
non-null object reference and displays
the resulting string in the To String Panel
in the top-level String/To String Window.
- Add to Watch Panel 1/2 - Adds the selected watch in the table to the other Watch Panel.
- Hex - displays the selected watch (which must
be of type short, int or long) in hexadecimal.
- Decimal - displays the selected watch (which must be
of type short, int or long) in decimal.
- Delete - deletes the selected watch
in the table.
- Unsort - returns the table data to its default order.
- Columns... - displays a dialog that allows the User to show or
hide individual table columns.
- Help... - displays this Help.
See the Watches Menu in the menu bar
to create a new watch and for
menu items that operate on all of the watches in the table.
©2001-2010. debugtools.com LLC. All rights reserved.