From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25794 invoked by alias); 30 Nov 2007 23:30:36 -0000 Received: (qmail 25774 invoked by uid 22791); 30 Nov 2007 23:30:29 -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; Fri, 30 Nov 2007 23:30:23 +0000 Received: (qmail 29743 invoked from network); 30 Nov 2007 23:30:21 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 30 Nov 2007 23:30:21 -0000 To: Eli Zaretskii Cc: Vladimir Prus , gdb@sources.redhat.com Subject: Re: Watchpoints with condition References: <200711301925.20196.vladimir@codesourcery.com> From: Jim Blandy Date: Fri, 30 Nov 2007 23:30:00 -0000 In-Reply-To: (Eli Zaretskii's message of "Fri, 30 Nov 2007 23:15:51 +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-11/txt/msg00303.txt.bz2 Eli Zaretskii writes: >> From: Vladimir Prus >> 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'?