This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Watchpoints with condition
Michael Snyder <msnyder at specifix.com> writes:
> On Tue, 2007-12-04 at 06:23 +0200, Eli Zaretskii wrote:
>> > Cc: gdb@sourceware.org
>> > From: Jim Blandy <jimb@codesourcery.com>
>> > Date: Mon, 03 Dec 2007 15:07:19 -0800
>> >
>> > In the use case you mention, why wouldn't 'watch v == X'; 'watch v ==
>> > Y'; etc. have worked for you? You would have gotten more hits than
>> > you'd like, but only twice as many --- is that right?
>>
>> It would have shown me hits I don't want to see, yes. And it is more
>> natural to write "watch X if X == 1" than what you suggest.
>
> I have to agree -- typing "watch X == 1" is intuitive to you and me
> (because we're gdb hackers), but it would not be intuitive to most
> users. Besides, as Eli says, it gives you unwanted hits. Why would
> we want to explain all of that (including the unwanted hits) to a
> naive user?
I guess I don't see why 'GDB stops your program whenever the value of
this expression changes' is hard to understand. Explaining
conditional watchpoints is a superset of explaining watchpoints, so I
don't see how it could be simpler.
*shrug*