You create a conditional (temporary) breakpoint or watchpoint in the Properties for C/C++ breakpoint dialog. Right-click a breakpoint or watchpoint in the Breakpoints view, then select Properties from the context menu. A conditional breakpoint or watchpoint has an associated conditional expression. The debugger evaluates the expression to determine whether to halt program execution at that breakpoint.
A conditional breakpoint or watchpoint behaves in two different ways:
Figure 1 Properties for C/C++ - breakpoint window
The Properties for C/C++ - breakpoint dialog appears (Figure 1). The Common panel is shown by default.
When entering a condition use the format: Variable <operator> value. For example, iCount == 5.
The Ignore count specifies how many times the breakpoint or watchpoint hits the condition before execution stops. The default setting is zero, which means the first time the breakpoint is hit, execution halts. For example, to stop at the breakpoint on the second time it is hit, enter an Ignore count of 1.
During subsequent debugging sessions, the debugger evaluates the expression to determine whether to halt program execution at the conditional breakpoint.
For more information on marker bar icons, see C/C++ Development User Guide > Concepts > Debug > Breakpoints.