About watchpoints

You can monitor a region of memory for specific kinds of memory accesses by setting a Purify watchpoint on it. Using watchpoints simplifies the task of debugging problems where memory mysteriously changes between the time it is initialized and the time it is used.

Purify watchpoints can report:

When you set a watchpoint, Purify automatically reports the exact cause and result of each memory access, even when you are not using a debugger. Since Purify already intercepts every memory access as part of its dynamic error detection, you can use watchpoints without any performance degradation.

Some uses for watchpoints

Watchpoints are useful when:

Why use Purify's watchpoints?

Watchpoints in many debuggers are sometimes implemented by single-stepping the program, and checking whether the value of a watched variable changes after each instruction. Under gdb, watching a single 4-byte word can slow the program by a factor of 1,000 or more.

Purify implements watchpoints by monitoring the addresses of the loads and stores performed by the program. This makes using Purify's watchpoints fast; there is no performance loss for requesting watchpoints, even those covering large regions of memory.

Purify's watchpoints are also more sensitive than those of a debugger. Purify warns you when watched data is read, when watched data in the heap is allocated or deallocated, and when watched data on the stack comes into or goes out of scope as it is included in the local variables of a function. Purify also catches a write to a watched variable when the value being written is unchanged.

You can set a watchpoint and then enable Purify's Just-In-Time debugging feature to start your debugger when Purify encounters the watchpoint.

Notes: