3.9 Assigning conditions to an existing breakpoint
Using the options available on the Breakpoint Properties dialog, you can specify different conditions for a specific breakpoint.
For example, you can set a breakpoint to be applicable to only
specific threads or processors, schedule to run a script when a selected breakpoint is
triggered, delay hitting a breakpoint, or specify a conditional expression for a
In the Breakpoints view,
select the breakpoint that you want to modify and right-click to display the
Select Properties... to
display the Breakpoint Properties dialog
Figure 3-7 Breakpoint Properties dialog
Breakpoints apply to all threads by default, but you can modify
the properties for a breakpoint to restrict it to a specific thread.
Select the Break on Selected
Threads option to view and select individual
Select the checkbox for each thread that you want to
assign the breakpoint to.
NoteIf you set a breakpoint for a specific thread,
then any conditions you set for the breakpoint are checked only for
If you want to set a conditional expression for a specific
In the Stop
Condition field, enter a C-style expression. For
example, if your application code has a variable
x, then you can specify: x ==
|See the break command to see how it is used to
specify conditional breakpoints.|
If you want the debugger to delay hitting the breakpoint until
a specific number of passes has occurred, then:
In the Ignore
Count field, enter the number of passes. For example, if
you have a loop that performs 100 iterations, and you want a breakpoint
in that loop to be hit after 50 passes, then enter 50.
If you want to run a script when the selected breakpoint is
In the On break, run
script field, specify the script file.
System... to locate the file in an external
directory from the workspace or click Workspace... to locate the file within the
NoteTake care with commands used in a script file that
is attached to a breakpoint. For example, if the script file
quit command, the
debugger disconnects from the target when the breakpoint is
Select Continue Execution if you want to
enable the debugger to automatically continue running the application on
completion of all the breakpoint actions. Alternatively, you can enter the
continue command as the last command in a
script file, that is attached to a breakpoint.
Select Silent if you want to hide breakpoint information
in the Commands view.
Once you have selected the required options, click OK to save your changes.