Assigning conditions to an existing breakpoint
Using the options available on the Breakpoint Properties dialog, you can specify different conditions for a specific breakpoint.
- In the Breakpoints view, select the breakpoint that you want to modify and right-click to display the context menu.
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 threads.
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 that thread.
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 == 10
See the break command to see how it is used to specify conditional breakpoints.
- In the Stop Condition field, enter a C-style expression. For example, if your application code has a variable
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.
Click File System... to locate the file in an external directory from the workspace or click Workspace... to locate the file within the workspace.
NoteTake care with commands used in a script file that is attached to a breakpoint. For example, if the script file contains the
quitcommand, the debugger disconnects from the target when the breakpoint is hit.
- In the On break, run script field, specify the script file.
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
continuecommand 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.