Possible Duplicate:
Can I set a breakpoint on 'memory access' in GDB?
I want to trace how a specific variable is initialized,
can gdb do this kind of job?
Possible Duplicate:
Can I set a breakpoint on 'memory access' in GDB?
I want to trace how a specific variable is initialized,
can gdb do this kind of job?
The gdb command watch <expr> sets a breakpoint on write, rwatch on read, and awatch  on read or write. You can use them as you would with breakpoints, with two considerations:
$esp+...)show can-use-hw-watchpoints.