NetBeans 6 Debugger Improvements
There are two major debugger improvements in Netbeans 6. The first one called 'Expression Stepping' is a new fine-grade stepping feature that can be used for detailed expression inspection. The second improvement called 'Heap Walking' is an integration of profiler-like heap walker into debugging workflow.
When debugging an expression, you can use the Step Over Expression command to achieve a more fine-grained stepping than other debugging steps. Step Over Expression enables you to proceed through each method call in an expression and view the input parameters as well as resulting output values of each method call. You can invoke the Step Over Expression command just as you would any other step commands. If there are no further method calls, Step Over Expression behaves like the Step Over command.
Each method call in an expression has some input (parameters) and output values. Each time you use the Step Over Expression command in an expression, the debugger resumes VM execution and then stops before executing the next method call. You can inspect the output values for the previous method and the input parameters for the next method in the Local Variables window. Invoking Step Over Expression again resumes the VM execution until the next method call in the expression.
Local Variables window informs you that the program counter is right before call to method 'getFactorial' and provide access to the list of arguments. Returned values of processed methods is displayed as well.
Expression stepping technology is also behind the implementation of Run Into Method action that suspends the execution after the specified method call has been entered. Run Into Method action can significantly simplify debugging of complex expressions.
Heap walking is a well-known profiling approach to memory heap inspection of static memory snapshots. On the other hand, Heap Walker integrated in NetBeans debugger provides view of live heap data any time the application is suspended (e.g. on a breakpoint or after a step).
The support for heap walking functionality is available when running on JDK 6 and newer. 'Loaded Classes' view displays the list of classes loaded in the debugged virtual machine sorted by the instance count. Instance browser window can be opened on every class type, providing detailed information about the instances and referring objects. This is valuable for solving memory leaks.
The number of instanced in memory heap. This view is automatically updated while the application is running.