Evaluating Data Values

Using the Debugger's Variables tab, you can evaluate a local or global variable that is within the scope of the object whose method you are stopped in. You set the scope in the Threads/Stack tab. You cannot evaluate an expression.

An evaluation evaluation tells the value of the variable at the current time. If you want to track the changes in a value as the program progresses, use the Threads/Stack tab.

To evaluate a variable:

  1. Open the Threads/Stack tab in the Debugger.

  2. Select the stack frame in which you want to evaluate data.

    A variable has a value when it is within the scope of the current location on the call stack.

  3. Click the Variables tab.

  4. In the left text field, type the name of the variable you want to evaluate.

    For example, to evaluate the variable maxsize in the package mypkg.Shapes, you would type mypkg.Shapes.maxsize.

  5. Click the Evaluate button.

The WorkShop prints the variable and its value in the scrolling list. Objects are marked with the glyph. When you click this glyph, the object or array expands to show all embedded variables. You can repeat this action on nested objects. To contract an object or array, click the glyph a second time.

If the list of evaluated variables becomes too long, you can clear it out using the Clear List button on the Variables tab.

Note

When evaluating a variable, the Java WorkShop does not distinguish package names from variable names. Consider the strings java.io.File.separator and myObj.myMember.myString. The WorkShop does not distinguish that java.io.File is a package name and that myObj.myMember is a member of an object. In all cases, the Debugger treats package names as members of objects.


See also:

Variables Tab
Threads/Stack Tab