(ddd.info)Breakpoint Conditions


Next: Breakpoint Ignore Counts Prev: Editing Breakpoint Properties Up: Breakpoints
Enter node , (file) or (file)node

5.1.6 Breakpoint Conditions
---------------------------

The simplest sort of breakpoint breaks every time your program reaches a
specified place.  You can also specify a "condition" for a breakpoint.
A condition is just a Boolean expression in your programming language.
A breakpoint with a condition evaluates the expression each time your
program reaches it, and your program stops only if the condition is
_true_.

   This is the converse of using assertions for program validation; in
that situation, you want to stop when the assertion is violated-that is,
when the condition is false.  In C, if you want to test an assertion
expressed by the condition ASSERTION, you should set the condition
`!ASSERTION' on the appropriate breakpoint.

   Break conditions can have side effects, and may even call functions
in your program.  This can be useful, for example, to activate functions
that log program progress, or to use your own print functions to format
special data structures. The effects are completely predictable unless
there is another enabled breakpoint at the same address.  (In that case,
DDD might see the other breakpoint first and stop your program without
checking the condition of this one.)

   Note that breakpoint commands are usually more convenient and
flexible for the purpose of performing side effects when a breakpoint
is reached.  Note: Breakpoint Commands, for details.


automatically generated by info2www version 1.2.2.9