Recipe 5.9 Setting a Hit Count for Breakpoints

     

5.9.1 Problem

You want to break only after a breakpoint has been encountered a specified number of times.

5.9.2 Solution

Breakpoints can be enabled after a specified number of hits, called a hit count . To set a breakpoint's hit count, right-click the breakpoint in the Breakpoints view and click Properties, opening the Java Line Breakpoint Properties dialog. Check the "Enable Hit Count" checkbox, and enter the hit count you want.

5.9.3 Discussion

You can see an example in Figure 5-16, in which the hit count of a breakpoint is set to 3.

Figure 5-16. Setting a breakpoint hit count
figs/ecb_0516.gif

Click OK to close this dialog, and then restart the debugging session (you can end the session by clicking the Terminate button, or by selecting Run Terminate and starting the debugging session again). When you do, execution will be suspended the third time that breakpoint is encountered.

You also can set a breakpoint's hit count by right-clicking the breakpoint in the Breakpoints view, clicking Hit Count, and entering the hit count you want in the dialog that opens.


5.9.4 See Also

Recipe 5.10 on configuring breakpoint conditions.



Eclipse Cookbook
Inside XML (Inside (New Riders))
ISBN: 596007108
EAN: 2147483647
Year: 2006
Pages: 232
Authors: Steve Holzner

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net