Re: Watchpoints with condition

Michael Snyder
2007-12-04T05:11:42Z

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?