Conditional breakpoints
Optional breakpoint parameters are used to control the behavior of breakpoints.
When you set a breakpoint, you can make it conditional by setting these parameters in the Optional parameters page of any breakpoint wizard:
Optional breakpoint parameter | Description | Type of breakpoint supported |
---|---|---|
Thread | Breakpoints can be thread-specific. You can specify whether
the breakpoint applies to all threads (the default) or only to one
( |
This parameter is supported by all breakpoint types. |
Frequency | Indicates when to stop on a breakpoint and when to skip it.
The debugger keeps track of how many times each breakpoint is encountered.
The fields in this section tell the debugger on which encounter of
a breakpoint the debugger will first stop, how often it will stop,
and on which encounter the debugger will no longer stop. The following parameters are used to set the breakpoint frequency:
|
This parameter is supported by all breakpoint types. |
Expression | You can enter an expression into this field. The execution
of the program stops at the breakpoint only if the condition specified
in this field tests true (any non-zero value is considered true). For example, if you are debugging a C++ program you can type the following expression:
A
conditional expression is any valid expression in the language of
the location of the breakpoint that evaluates to a number, and does
not have side effects or involve calling a function. For C and C++,
all assignment operators, and the increment and decrement operators
( Attention: Even though an application does not appear to stop
at a breakpoint whose condition has not been met, the debugger temporarily
suspends the application while it evaluates the condition. For most
purposes, this short pause is not significant. However, in a multithreaded
application, a pause may cause the operating system to change the
order in which threads are dispatched.
|
Line, Entry, Statement, Watch, and Address. |
Action | You can specify debug console commands in this field. | Address, Entry, Statement, and Watch |