rwatch (gdb mode only)

Set a read watchpoint on the specified expression.

Syntax

rwatch expr  

Parameters

expr

The expression on which to set the watchpoint.

Description

This command sets a read watchpoint on the specified expression. When the debuggee reads the value of the specified expression, it stops.

Watchpoints are also referred to as data breakpoints.

Example

Consider lines 20-28 of code in a source file named hello_simple.c:

20          glob = 1;
21          glob = 11;
22          glob = 111;
23          glob = 1111;
24
25          readGlob(glob);
26          readGlob(glob);
27          readGlob(glob);
28          readGlob(glob);

In the following example, the debugger starts at the beginning of line 20. Observe that when a read watchpoint is set on the variable glob, as the debugger advances, it does not stop when the value of glob changes, only when it is read.

Breakpoint 1, main () at hello_simple.c:20
20          glob = 1;

(idb) rwatch glob
Hardware read watchpoint 2: glob
(idb) c
Continuing.
Hardware read watchpoint 2: glob
 
Value = 1111
0x080483e5 in main () at hello_simple.c:25
25          readGlob(glob);

See Also


Submit feedback on this help topic

Copyright © 1996-2010, Intel Corporation. All rights reserved.