The Variables tab is the debug tab most frequently used tab when you are debugging because it is the place where you will inspect your program's fields, values, and local variables.
The variables table will be initially empty if the current thread is not suspended or if the current thread does not have any stack frames (ie. it is a zombie thread). Unlike most other debug tabs that display information about a debuggee's internal state, the Variables tab will retain the information in the tab when a debugging session is resumed so that next time the debug session is paused, BugSeeker will be able to compare the new variable values with that of the old values if execution is paused in the same object as before.
All right-click popup menu commands will be disabled when a debug session is resumed and be activated again when a debug session is paused.
Name Column
If the execution point is currently in a non-static method, the first variable listed in the Variables tab will be the special 'this' variable which refers to the current object whose method we are in. If the execution point is located in a static method, there will be no 'this' variable. Instead, a special 'static' node will be present which when expanded will display the static values for the current class to make it easier for you to debug static methods that access/modify static fields of the same class.
Only local variables that are currently in scope will be displayed in the Variables tab. To see the individual values of reference types like objects and arrays, you will need to expand the tree node to see the fields or elements within that reference type. For an object, only those fields declared within the object's direct type are displayed. Non-static fields are displayed first followed by all static fields and their values (if the Show statics fields with instance fields option is enabled in Tools | Options | Debug category). To access fields that are declared in the object's superclasses, there will be a superclass node at the top which when expanded, will display the values of all fields declared within that superclass.
When inspecting the values of fields in an object, an icon representing a field's visibility will appear next to the field's name.
Value Column
Local variables and fields that are of primitive type will display their values directly in the Value column.
Values that contain other values will appear expandable and have a value string of "{...}". Most reference types are like this except arrays and array ranges which will display the length of the array in the value column. If the value of a reference type is null, the word null will appear in the Value column for that variable or field.
Strings are also special and will display their contents in the value column surrounded by quotation marks (""). These quotation marks are only meant to easily convey that the value is a String; the String's contents does not actually contain the leading and trailing double quotes that appear in the Value cell for that String.
Type Column
The type column always reports the actual type of the object rather than the declared type of the field or local variable unless the current value is null.
ID Column
Displays the unique identifier that is assigned to objects by the debuggee's VM. This identifier shall be guaranteed to be unique for objects from the same VM as long as the object has not been garbage collected. The identifier can be used to quickly determine whether two objects are the same object because if they are they will have the same identifier value. Column will appear blank for nodes that are not objects.
Array display
Primitive arrays whose lengths are longer than 100 will be partitioned into several array ranges. This allows you to quickly jump to an array section without having to scroll down through many array elements after you expand an array. The name of an array range will have the format [16-31] which indicates that array elements 16 to 31 (all inclusive) can be found anchored off this node. The actual numeric ranges for the array will vary, depending on the side of the array.
For large reference type arrays, if the Hide null array elements option is disabled (Tools | Options | Debug category) the reference type array will be partitioned similarly to the way mentioned above. If this option is enabled, however, reference type arrays will never be partition but rather BugSeeker will examine all array elements and display those array elements whose value is not null.
Modifying values
To modify the value of any primitive type local variable or field, double-click on its value cell and a mini text editor will be appear in the cell's place so that you can enter in a new value. You are currently restricted to entering only constant values; that is, you may not enter expressions for BugSeeker to evaluate and then assign to this local variable/field.
BugSeeker specially supports modifying String values directly. Double-clicking on the value cell of a String will allow you to edit or enter a new String value into the text field that will appear. Since Strings are immutable, when you modify a String value you will be creating a new String and assigning this new String to the local variable or field.
To edit the value of a char you first need to understand how its value is displayed in the Value column. The value of the char will be surrounded by single quotes followed by a space and then value of the char converted to an integer. When you modify a char value you may either enter the new char value by surrounding the value entered in single quotes in which case the value be come that character entered as is or you can specific an integer value and the character's new value will be the integer converted into a character.
When modifying a char value, BugSeeker does not currently support entering character escape sequences nor unicode escape sequences nor hexadecimal character values. If you need to enter these special characters, non-printable character please enter the integer code instead.
To edit or modify the value of any other reference type or to modify a value by assigning it the result of an expression that is to be evaluated, you will need to right-click on the variable node and select Inspect In New Window which will display your variable node in a new Inspector window. The Inspector window has a Modify tab that will let you enter an expression that BugSeeker will evaluate and assign the resulting value to the local variable or field you are inspecting.
Coloring
Values that have changed since last time they were viewed will be highlighted in red. Local variables that are method arguments will have their name colored blue. Superclass nodes that when expanded will display the values of fields defined in that superclass will be highlighted in light grey. All colors can be customized (Tools | Options | Color category).
Expanding and collapsing variables
As you expand nodes and scroll downwards, you may find to inconvenient to have to navigate back to the top using the scrollbar, especially when you have expanded a large array. To quickly collapse an expanded node, right-click any children of the expanded node and select Collapse Parent.
To quickly collapse all expanded nodes, right-click anywhere in the Variables tab and select Collapse All.
Shortcut: when the Variables table has keyboard focus, you can use the left and right arrow keys to collapse and expand nodes, the home and end keys to jump to the first and last children node, the ctrl-home and ctrl-end keys to jump to the start and end of the variables list.
Hexadecimal display
Integral values (ints, shorts, chars, bytes and longs) can be viewed in hexadecimal format. To switch between hexadecimal display mode and decimal display mode, right-click anywhere in the Variables tab and select Hexadecimal Display from the popup menu to toggle on/off hexadecimal display mode.
Add To Watch
This convenient feature that allows you to quickly add a field or local variable that you wish to examine separately or to keep a watch on to the Watch tab. Simply select the field or local variable you wish to watch, right -click the selected node and select Add To Watch. Doing this saves you from having to manually type the watch expression yourself in the Watch tab.
Not all nodes can be added to the watch. For instance, superclass nodes cannot be watched although values within the superclass node can be watched. Array ranges also cannot be added to the Watch tab, nor can you add the special top-level 'static' node to the watch. In other words, you can only add fields, local variables and the special 'this' node to the watch.
Inspect in New Window
If you would like to display a variable node in a separate tree in a separate window that is free from the confines of the Variables tab, right-click the desired variable node and select Inspect in New Window from the popup menu. A new Inspector window will be displayed that you can then resize to whatever dimensions you desired so that you can easily examine the values for that node.
This feature is especially useful when you need to examine the value of a very large String because the Inspector window has an Evaluate tab that will display the value's contents in a scrollable text area which is much better than the limited table cell.
Not all nodes can be viewed in a new Inspector window. The nodes that you wish to inspect in a new window must be capable of being converted into a valid expression as that is how the Inspector window is able to display the selected node in a new window by evaluating the node's expression.
Shortcut: if you press CTRL-C while a variable node's name is selected and has keyboard focus, an expression that evaluates to that node will be copied to the clipboard that you can later past into an existing Inspector window to be evaluated. If the node selected cannot be expressed as an expression, the node's name will be copied to the clipboard instead.
Refreshing the display
Right-click anywhere within the Variables tab and select Refresh which will refresh all the values in the variables table. Using this command will clear all values that have been marked as modified (highlighted in red).
Missing local variables
If you see the special message node display reporting that Local variable debug info is absent - please recompile this class with debug info, the current class you are inspecting was not compiled with the debug info. Please see the Compiling Classes with Debug Information section of this manual for details on how you can avoid this message.