Set a write watchpoint on the specified expression.
watch lvalue
lvalue |
An expression that designates a memory location. |
This command sets a write watchpoint on the specified expression. When the debuggee writes to the memory location designated by lvalue, it is stopped by the debugger after the write has occurred.
The debugger does not detect a write to a watched memory location if the value at that location is not changed.
Watchpoints are also referred to as data breakpoints.
Consider lines 20-23 of code in a source file named hello_simple.c:
20 glob = 1; 21 glob = 11; 22 glob = 111; 23 glob = 1111;
In the following example, the debugger starts at the beginning of line 20. Observe that when a watchpoint is set on the variable glob, as the debugger advances, every time the value of glob changes, the debugger stops and prints the old and new values of the variable.
(idb) watch glob Watchpoint 2: glob (idb) c Continuing. Old value = 0 New value = 1 Watchpoint 2: glob main () at /hello_simple.c:21 21 glob = 11; (idb) Continuing. Old value = 1 New value = 11 Watchpoint 2: glob main () at /hello_simple.c:22 22 glob = 111;
Copyright © 2001-2011, Intel Corporation. All rights reserved.