Watchpoints with condition

Daniel Jacobowitz drow@false.org
Mon Dec 3 18:11:00 GMT 2007


On Mon, Dec 03, 2007 at 09:54:41AM -0800, Jim Blandy wrote:
> Okay, so 'watch foo if foo == 1' has some interesting behavior:
> - if foo is 1 when the watchpoint is set, then the watchpoint doesn't
>   trigger until foo becomes != 1, and then becomes 1 again.
> - If foo is != 1 when the watchpoint is set, then the command is
>   equivalent to watch foo == 1.

No.  When foo goes back to zero, "watch foo == 1" stops.  "watch foo
if foo == 1" does not.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb mailing list