User`s guide
Setting Breakpoints
63
dbx still needs to use the single-step approach if the stop command contains
an expression to watch, such as instop if global == 1. The performance
of the debugged program can be greatly enhanced by including a variable to
watch in the stop command.
For example, the previous stop command can be expressed equivalently as
stop global if global == 1. This instructs the debugger to check only
the expression global == 1 if the value of global changes. For situations
where the expression does not depend upon a particular variable getting
modiļ¬ed such as stop if global == x * 3, the single-step approach is the
only way to achieve the desired behavior.
Stopping If a Test Expression Is True
By including a test clause in your stop command, you can cause dbx to stop
if the value of an expression is true. You can use any valid numerical
expression as a test. If the result of the expression is nonzero, the expression
is true and the test is successful.
The point at which dbx evaluates the test expression depends on the
command that you use to set the breakpoint:
stop if expression
Evaluates the expression before executing each source line.
Note that execution is very slow if you choose this type of
conditional breakpoint.
stop at line if expression
Evaluates the expression at the given line.
stop in procedure if expression
Evaluates the expression at every source line within a given
procedure.
Conditional Breakpoints Combining Variable and Test
Clauses
You can create conditional breakpoints that combine both variable and test
clauses. In these cases, the overall test evaluates to true only if both clauses
are true.