FeaturesPluginsDocs & SupportCommunityPartners

Debugger: New Features Proposal

NetBeans 3.2


Version:
1.2

Author:
Jan Jancura <jan.jancura@czech.sun.com>

Document History:
[06/06/2001] : version 1.2 : Integrated in NB3.2 marks added.
[12/06/2000] : version 1.1 : Added new features from Bugzilla enhancements.
[09/26/2000] : version 1.0 : Created and edited from individual contributions.

Contents:
- API improvements
- Classes tab
- Monitor information
- Debugger<> Editor & Debugger <> Explorer integration improvements
- Filtering of variables hierarchy
- Debugger UI Improvements
- Variables view
- Class view
- Skip Filters

1. NetBeans 3.2

1.1 Must-have features

API improvements (integrated in NB3.2)

All debugger modules installed to NetBeans / Forte should share actions, desktop and the Debugger window with set of watches, breakpoints and threads. In the IE multisession debugger implementation they need to share information about current session / thread. That is why we have the debuggerCore module, which defines common debugger's functionality and most of UI. Now we are working on a better support for debugger implementation modules which do not use watches or threads, and for non-java language debuggers.

Classes tab (integrated in NB3.2)

Shows all currently loaded classes. For each class shows methods, static variables and class loader. User could add breakpoint on method / class here.

Monitor information (integrated in NB3.2)

Display information about contended / owned monitors for each thread so user can easily recognize deadlocks and other synchronization issues. Monitor information should be accessible in Threads tab in Debugger window:
 Main thread
 |- Stack trace
 |   |-... 
 |
 |- Locales 
 |   |-...
 |
 |- Waits on: java.awt.Compomponent.LOCK 
 |   |- Owned by: AWT thread
 |   |   |- Stack trace
 |   | ...
 |   |- Other waiting threads
 |
 |- Owned monitors.
 |   |- com.asd.Asd
 |   |   |- Waiting threads
 |   ...
 ...

1.2 Should-have features

Debugger<> Editor & Debugger <> Explorer integration improvements

  • There are two main places from which the NetBeans debugger is currently driven: Editor & Debugger Window. But the pass from editor to the Debugger Window is not very comfortable. For example if a session stops on a breakpoint - line is highlighted in the Editor - user must find this breakpoint in the Debugger Window manually, and the same holds for the current thread. So we want to add:
    • "Go to Breakpoint" to the editor's popup on the breakpoint line, which transfers focus to the Debugger Window / Breakpoints tab and selects proper breakpoint.
    • "Go to Thread"  to the editor's popup on the current line, which transfers focus to the Debugger Window / Threads tab and expands & selects proper thread.
    • "Go to Locales"
    • "Go to Watches"
  • We plan to add "Add Breakpoint on Line / Method / ..." everywhere it is possible. Explorer Nodes of Java DO, editor's popup menu, editor's margin etc.
  • Add a special debugger margin to the editor window. It could contain:
    • Information if this line produces some bytecode.
    • Shortcut for adding line breakpoints.
    • Info if this line is currently in some stack trace of some thread + info about the thread state (like thread waits on this line).
    • Shortcut for stack trace traversing (up, down).

Filtering of variables hierarchy

The current version of NetBeans Debugger shows all static / private / ... fields for variables in Watches & Variables tabs. It is useful when you want to find some implementation details, but it can be uncomfortable for many other purposes. For example if I am inspecting instance of java.util.Vector, I want probably see its content not its serialVersionUID, capacityIncrement etc.


So we plan to add some variable filtering capability to NetBeans Debugger.

Where it can be used:

  • Default filter: Filtering "static / public / private ... / generated by compiler / null" field categories.
  • Collections view: filter for Vectors, Hashtables ...
  • Component view: if we want to focus on Component hierarchy.
  • Object view: Shows dependencies of objects (may be from some package) only. Values of primitive types can be shown as properties.
  • Beans filter
This feature should be useful for debugging non-java languages too. For some language compiled to Java may be useful to hide (or rename, represent in the different way) some variables. Such module should install some filter to NetBeans Debugger.

1.3 Nice-to-have features

Debugger UI Improvements

  • Breakpoint Grouping: It is a good idea to logically organize breakpoints in the case of large projects. Grouped in a group, they can be enabled, disabled, or removed as a single unit. A group can be visually implemented by a node in the Debugger Window, tab Breakpoints. Descendant nodes should represent all breakpoints (eventually sub-groups) belonging to the group.
  • Displaying Integral Values in Various Formats (Daniel Prusa): We support displaying integral values in the decimal format only. The ability of displaying integral values in the hexadecimal, octal and binary format can be added. Every variable can have property "Format" with the default value "decimal".
  • Configurable Format of Display Text for Watches (Daniel Prusa): Format of display text for watched variables can be configurable. The user could chose what information about variables he/she prefers (name, type, toString() value, value - in case of primitive type, hashcode, identity hashcode, internal id, etc.) and in what format it should be displayed.
  • Predefined watch name (Jan Stola): When I place a caret on some variable definition and try to create a new breakpoint the name of this variable is offered to me (so, I can easily create my variable breakpoint). I think it would be nice to have the same support for watches.
  • Property editor for Print text property of breakpoints (Jan Stola): It would be nice to have property editors for print text properties of breakpoints. In the present situation the user don't know which substitutions could he/she use, e.g. {lineNumber}, {className} etc.
  • There should be access/modification variable breakpoint. (Jan Stola)
  • Disabled breakpoints could have different icon (Svatopluk Dedic)
  • Info dialog could appear when user put breakpoint into white line.
  • Return to previous workspace property (Kurt Westerfeld): We have "Global Options/Debugger Settings/Workspace" property which defines which workspace should be used for debugging (when debugging starts IDE switches to it). But we do not returns to the previous workspace after debugger finish.
  • Use dialog boxes for breakpoint notification (Kurt Westerfeld): Current version of NetBeans Debugger uses output window for breakpoint event notifications. We could add some "Pop-up dialog" option as an breakpoint action (like "Print text" option - see properties of breakpoint).
  • Distinguish between own and inherited fields in variables (Kurt Westerfeld):
  • Enable to call some method on variable selected in Watches tab
  • Call stack view (integrated in NB3.2): Threads tab is designed for displaying info about threads/thread groups hierarchy. It's usefull for inspecting not-current threads too. Call stack tab should be focused on "current context" only. It should contain call stack of current thread.

Expression view (Jan Jancura, Kurt Westerfeld)

It could be useful to have a new view (tab in the Debugger Window) which returns variable value (like in watches) for expression written in some input line.

2. NetBeans 3.3

2.1 Must-have features

2.2 Should-have features

Variables view

Alternate visualization tool like Canvas can be useful for quick browsing on Watches / Locales / Variables hierarchy. It should display non-primitive object instances only (no int, Integer...) with their dependences in scrollable view (JProbe style).

Class view

We have an idea to display current state of debugged application (or part of it e.g. package) in UML style Class diagram.

Skip Filters (Daniel Prusa)

Skip filter feature can allow specify classes, packages, or class patterns that we do not wish to step into. It is useful if we are only interested in tracing through our own code and want to avoid stepping into outside libraries.

2.3 Nice-to-have features

3. Future Releases

Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by