Conditional breakpoints in winIDEA can help you stop the CPU on the Xth pass through a function:
Each time the breakpoint is run into, the expression (if present) is evaluated. If it is evaluated as true, it adds one more pass count. When the breakpoint is passed the specified number of times, the breakpoint is triggered, and the CPU stops.
To set up conditional breakpoints:
1. Set a breakpoint.
2. Open Debug | Breakpoints.
3. Check the Enable box in the Condition section.
4. Set the Pass count and optionally define Expression.
5. You can display message box when a conditional breakpoint hits.
6. (optional) Add the Expression to Watches and enable real-time. You can observe the value changing.
7. Run the application.
winIDEA will show RUNNING Debug Status in the bottom right corner.
The CPU stops each time a conditional breakpoint is passed to evaluate the condition and then resumes execution.
If the option Reset conditional BP counters when CPU stops in Debug | Debug Options is enabled, the pass counter will reset each time a conditional breakpoint is hit.