From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8365 invoked by alias); 1 Dec 2007 01:46:12 -0000 Received: (qmail 8357 invoked by uid 22791); 1 Dec 2007 01:46:11 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 01 Dec 2007 01:46:04 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id 44C403BEFB; Fri, 30 Nov 2007 17:46:03 -0800 (PST) Subject: Re: Watchpoints with condition From: Michael Snyder To: Russell Shaw Cc: gdb@sources.redhat.com In-Reply-To: <4750B480.8060106@netspace.net.au> References: <200711301925.20196.vladimir@codesourcery.com> <4750B480.8060106@netspace.net.au> Content-Type: text/plain Date: Sat, 01 Dec 2007 01:46:00 -0000 Message-Id: <1196472771.2501.184.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-4.fc7) Content-Transfer-Encoding: 7bit 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/msg00003.txt.bz2 On Sat, 2007-12-01 at 12:10 +1100, Russell Shaw wrote: > 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 frequently need to enable or set a breakpoint only if another > previous point in the program has been passed. How do i do that? set $passed_milestone = 0 break milestone_func commands silent set $passed_milestone = 1 end break conditional_func if ($passed_milestone)