Expressions Panel
The Expressions Panel is a panel in the top-level
Main Window.
The Expressions Panel allows the user to interactively evaluate
simple expressions including method calls. See the General and also Expressions
tabs in the Global Settings Dialog for Expression
Panel options.
input
A simple expression can be typed in the lower text field followed by
hitting the Enter key. The entered expression is displayed (in red) and the
resulting type name and output is displayed (color-coded),
in the upper text pane.
If an error is encountered then the resulting error message is
displayed (in red) in the upper text pane.
valid expressions
Valid expressions in the current scope are:
- Local variable name
- Class (This) field name
- objectRef.fieldName (can be a private field)
- arrayRef[i] or arrayRef[2], or arrayRef.length
- fullPackageName.className.staticField
If the result of the expression is an object, then the corresponding
object ID and class name will be displayed first. Then the corresponding
object fields will be displayed, in the inheritance hierarchy.
If the result of the expression is an array, then the corresponding object ID,
and array element type name and array length will be displayed first. Then
the corresponding array elements will be displayed.
If the result of the expression is a String, then the corresponding String
data will be displayed.
method calls
A single method call can also be invoked:
- If the result of an expression is an object, then append the method call.
- A method call in the current scope.
- A static method call by typing the full package name,
class name, and method name.
Method arguments can be local variables or field names in the current scope,
or values such as: null, true,
this, 4, 5.2, "test", 'c'.
Note well that invoking the method call causes all threads
in the target JVM to be resumed. The target JVM thread (the debug event thread)
where the last debugger event occurred (such as hitting a breakpoint), will
execute the method call. When the method call
invocation completes, the target JVM will be suspended again. The debug
event thread will be suspended once again, at the location it was previously
suspended at, before the method call invocation. All other
target threads may have advanced location.
context menu
A popup Context Menu can be displayed by right clicking on the upper text pane:
- Clear... - clears the upper text pane. A confirmation dialog will be displayed.
The same menu item is found in
the Clear menu in the menu bar.
- Help... - displays this Help.
©2001-2010. debugtools.com LLC. All rights reserved.