Content #
Sometimes it’s useful to tell the debugger to stop at a break point only if some condition is met, like the when a variable has a particularly interesting value. Conditional Breakpoints is similar to watchpoints work, but with an important distinction.
If you have a suspicion about where a variable is getting a bogus value, a conditional breakpoint is preferable to a watchpoint.
The watchpoint will break whenever that variable changes value. The conditional breakpoint will only break at the suspected problem code, and then, only when the variable takes on the bogus value.
Watchpoints are good when you haven’t a clue where the variable is receiving its bogus value. This is particularly useful for global variables or local variables that are continually passed between functions.