Event Specification |
dbx provides two syntaxes for specifying watchpoints:
This syntax lets you specify the kind of access to be watched for
stop|when|trace access mode <address-expression> [ , byte-size-expression ]
where:
r | read, memory loads |
w | write, memory stores |
x | execute, execution of code |
b | stop before the access |
a | stop after the access (default) |
stop access w 0x5678, sizeof(Complex)
This mechanism is mostly implemented in the kernel (see the proc(4) man page under PCWATCH for more details) and offers the following advantages over the older mechanisms:
The mechanism has the limitation that no two watched regions may overlap.
stop|when|trace modify address-expression [ , byte-size-expression ]
This syntax is still accepted for backward compatibility and maps to the appropriate stop access command.
stop|when|trace cond condition-expression
stop|when|trace change variable
These automatically single-step through the program and check for the given condition or change. Because of the single-stepping they are very slow and do not apply to multi-threaded applications.