From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3362 invoked by alias); 30 Nov 2007 16:37:54 -0000 Received: (qmail 3348 invoked by uid 22791); 30 Nov 2007 16:37:54 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 30 Nov 2007 16:37:48 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 82F1B98248; Fri, 30 Nov 2007 16:37:46 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 415E498245; Fri, 30 Nov 2007 16:37:46 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1Iy8s5-00034w-F2; Fri, 30 Nov 2007 11:37:45 -0500 Date: Fri, 30 Nov 2007 16:37:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: Watchpoints with condition Message-ID: <20071130163745.GA11508@caradoc.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: <200711301925.20196.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200711301925.20196.vladimir@codesourcery.com> User-Agent: Mutt/1.5.15 (2007-04-09) 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/msg00297.txt.bz2 On Fri, Nov 30, 2007 at 07:25:19PM +0300, Vladimir Prus wrote: > > 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 haven't, but here's a use case: if the condition is something you couldn't set a watchpoint on or would take too many hardware resources to watch. E.g. set $name = "my_function" watch global_variable if strcmp (cfun->name, $name) == 0 -- Daniel Jacobowitz CodeSourcery