< Day Day Up > |
Recipe 5.9 Setting a Hit Count for Breakpoints5.9.1 ProblemYou want to break only after a breakpoint has been encountered a specified number of times. 5.9.2 SolutionBreakpoints 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 DiscussionYou 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 countClick 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.
5.9.4 See AlsoRecipe 5.10 on configuring breakpoint conditions. |
< Day Day Up > |