This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Watchpoints with condition
- From: Jim Blandy <jimb at codesourcery dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: Vladimir Prus <vladimir at codesourcery dot com>, gdb at sources dot redhat dot com
- Date: Fri, 30 Nov 2007 15:30:21 -0800
- Subject: Re: Watchpoints with condition
- References: <200711301925.20196.vladimir@codesourcery.com> <uhcj31lko.fsf@gnu.org>
Eli Zaretskii <eliz at gnu.org> writes:
>> From: Vladimir Prus <vladimir@codesourcery.com>
>> Date: Fri, 30 Nov 2007 19:25:19 +0300
>>
>>
>> GDB presently allow a watchpoint to have a condition, and I wonder
>> what are the use-cases for that.
>>
>> If anybody has used watchpoint in condition in practice when debugging
>> real problem (as opposed to just playing with gdb, or making up
>> possible uses), can he share why it was needed?
>
> I use it quite a lot. The simplest use case is like this:
>
> (gdb) watch foo if foo == 1
Isn't that equivalent to 'watch foo == 1'?