04. Basic Functions - ThisTestUser/Java-Debugger GitHub Wiki

Once you've got Java Debugger set up, it's time to understand how it works.

javadebugger

The top left is a tree of the current class and all the fields in that class. Opening the fields via the plus button gives all the fields in the class of the field type (which is displayed in the parentheses), not the actual field value itself. For example, a field with a type of "ClassA" that has a value that is an instance of "ClassB" will display the fields of ClassA when opened. If the field value is accessible and is displayable (primitive, string, or enum), it will be displayed.

Note that fields in the tree are cached, so any value changes will not be reflected if the field has been loaded.

"Show All Fields" does work here, but you have to refresh the tree for it to show if the tree is already loaded.

In order to filter out the fields, you can type something into the search bar below. This searches not just the field name, but the literal string value of the tree node.

Search_1

However, sometimes you want to search only inside a specific field. In the example on the top, I only want to search inside "enumField", but if I type something like "ENUM1", the "enumField" itself will get filtered out. To fix this, right click it and enable Specific Search, and you can only search inside it.

Search_2

To load the field value as a new tab, right click the field and press "Load as Tab". The class name will be the value's class, which can be different from the field type. Null and inaccessible fields will not be loaded, nor will arrays be.

The right column is a table of the fields and methods of the selected entry in the left. If no entry is selected, the fields and methods of the class loaded are displayed. In the picture at the top, we can see the methods of com.thistestuser.test.Test.

The lightning icon for methods shows that you can run it, and the wrench icon for fields shows that you can edit it. The icon only shows if you can access the type (if the method/field is non-static, you need the instance object) and it contains editable types (for fields it must be primitive/enum/string or an array of any three, for methods it's the type arguments). Pressing "Show All Fields" or "Show All Methods" will show fields/methods from superclasses, but will only take effect if the fields/methods are loaded after the option is checked.

The "Load Class" button on the menu allows you to load a class as a tab. The checkbox is for if the tab you have selected is a ClassLoader instance, but otherwise it will not work. Note that the class loaded will not have access to non-static fields.

The "Dump Resource" button allows you to dump a resource to a file of your choice. This will use the tab selected's class to get the ClassLoader. The checkbox is for if the tab is a ClassLoader instance. Note that while this will allow you to dump class files, it may not work with encrypted class loaders, as it sometimes will dump the encrypted class.