From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18481 invoked by alias); 3 Dec 2007 23:07:31 -0000 Received: (qmail 18409 invoked by uid 22791); 3 Dec 2007 23:07:30 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 03 Dec 2007 23:07:21 +0000 Received: (qmail 23375 invoked from network); 3 Dec 2007 23:07:20 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 Dec 2007 23:07:20 -0000 To: Eli Zaretskii Cc: gdb@sourceware.org Subject: Re: Watchpoints with condition References: <200711301925.20196.vladimir@codesourcery.com> <20071130234853.GA27583@caradoc.them.org> From: Jim Blandy Date: Mon, 03 Dec 2007 23:07:00 -0000 In-Reply-To: (Eli Zaretskii's message of "Mon, 03 Dec 2007 22:59:37 +0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00016.txt.bz2 Eli Zaretskii writes: >> I think the only valuable use case for conditional watchpoints is the >> one you mentioned, where Y is something expensive, and X is some >> cheaper conservative approximation to the condition we really want. > > Well, you are wrong (and Daniel explained one reason why). Believe > me, this use case is very useful and important. (Actually, it was one > of the main reasons I got involved with fixing x86 hardware > watchpoints at the time: I needed to set several watchpoints on the > same variable, each one watching a different value being written.) I don't want to believe you; I want to understand it for myself. :) What I understand Daniel to be saying is that 'watch X if Y' allows you to restrict yourself to transitions into a certain state, whereas any 'watch Y' will always report both transitions to and from the state. 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?