RSS

Search Engine

Tuesday, June 8, 2010

Advanced Debugging

4.1. Skip all breakpoints

If you want to temporary de-activate all your breakpoints you can press the button "Skip all breakpoints" which is visible if you select the tab breakpoints.

If you press this button again the breakpoints will get activated again.

4.2. Breakpoint Properties

After setting a breakpoint you can select the properties of the breakpoint to for example use a condition to restrict when the breakpoint should get toggeled. In the properties you can for example restrict that the breakpoint should only be executed the 12 hit (Hit Count) or you can put in a conditional expression (which you can also use for logging if you want).

4.3. Watchpoint

A watchpoint is a breakpoint at which is stop whenever a field read or changed. You can set a watchpoint through a double-click on the left side before the field declaration. Via the properties of the watchpoint you can define if the breakpoint should be hit during read access (Field Access) or during write access (Field Modification).

4.4. Exception Breakpoint

The application is stopped if the specified exception is thrown. To define an exception breakpoint click on the following icon.

You can define if you want to stop and caught and / or uncaught exceptions.

4.5. Method Breakpoint

A method breakpoint is defined via double-click in the left border of the editor and the method head. You can define if you want to stop the program during method entry of after leaving the method.

4.6. Class breakpoint

A Class Load Breakpoint will stop when the class is loaded. Right-click on a class in the Outline View and choose "Toggle Class Load Breakpoint"

4.7. Hit Count

For every breakpoint you can define via the properties the hit count. If you use the hit count then the application is stop then the breakpoint is reached the number of times defined in the hit count.

4.8. Drop to frame

Eclipse allows you to select any level (frame) in the call stack during debugging and set the JVM to restart to that point.

This allows you to rerun a part of your program. Be aware that variables which have been modified by the code which you reset remain modified. The drop to frame will return to the the code. Changes made by the code, e.g. to variables / databases will not be reset.

To use the feature select the level in your stack and press the highlighted button.

0 comments:

Post a Comment