You copied the Doc URL to your clipboard.

Working with conditional breakpoints

Conditional breakpoints have properties assigned to test for conditions that must be satisfied to trigger the breakpoint.

For example, using conditional breakpoints, you can:

  • Test a variable for a given value.

  • Execute a function a set number of times.

  • Trigger a breakpoint only on a specific thread or processor.

During execution, the specified condition is checked and if it evaluates to true, then the target remains in the stopped state, otherwise execution resumes.

Note

  • Conditional breakpoints can be very intrusive and lower the performance if they are hit frequently since the debugger stops the target every time the breakpoint triggers.
  • You must not assign a script to a breakpoint that has sub-breakpoints. If you do, the debugger attempts to execute the script for each sub-breakpoint. If this occurs, an error message is displayed.

Breakpoints that are set on a single line of source code with multiple statements are assigned as sub-breakpoints to a parent breakpoint. You can enable, disable, and view the properties of each sub-breakpoint in the same way as a single statement breakpoint. Conditions are assigned to top level breakpoints only and therefore affect both the parent breakpoint and sub-breakpoints.

Considerations when setting multiple conditions on a breakpoint

Be aware of the following when setting multiple conditions on a breakpoint:

  • If you set a Stop Condition and an Ignore Count, then the Ignore Count is not decremented until the Stop Condition is met. For example, you might have a breakpoint in a loop that is controlled by the variable c and has 10 iterations .If you set the Stop Condition c==5 and the Ignore Count to 3, then the breakpoint might not activate until it has been hit with c==5 for the fourth time. It subsequently activates every time it is hit with c==5.

  • If you choose to break on a selected thread or processor, then the Stop Condition and Ignore Count are checked only for the selected thread or processor.

  • Conditions are evaluated in the following order:

    1. Thread or processor.

    2. Condition.

    3. Ignore count.

This section contains the following subsections:

Related information