This is the mail archive of the
mailing list for the GDB project.
Re: Watchpoints with condition
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb at sourceware dot org
- Date: Mon, 3 Dec 2007 13:11:19 -0500
- Subject: Re: Watchpoints with condition
- References: <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org> <20071130234853.GA27583@caradoc.them.org> <email@example.com>
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.