From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6585 invoked by alias); 4 Dec 2007 10:48:33 -0000 Received: (qmail 6576 invoked by uid 22791); 4 Dec 2007 10:48:33 -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; Tue, 04 Dec 2007 10:48:29 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id ED7C83C18C; Tue, 4 Dec 2007 02:48:26 -0800 (PST) Subject: Re: Watchpoints with condition From: Michael Snyder To: Vladimir Prus Cc: gdb@sources.redhat.com In-Reply-To: <200712041025.15416.vladimir@codesourcery.com> References: <200711301925.20196.vladimir@codesourcery.com> <1196733050.2501.200.camel@localhost.localdomain> <200712041025.15416.vladimir@codesourcery.com> Content-Type: text/plain Date: Tue, 04 Dec 2007 10:48:00 -0000 Message-Id: <1196764468.2501.277.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/msg00022.txt.bz2 On Tue, 2007-12-04 at 10:25 +0300, Vladimir Prus wrote: > On Tuesday 04 December 2007 04:50:50 Michael Snyder wrote: > > On Fri, 2007-11-30 at 19:25 +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? > > > > > > May I ask, what prompts the question? > > Were you thinking of getting rid of it? > > I'm merely trying to understand the use cases. One of the specific > concern is what happens if a watchpoint's condition refers to a global > variable in a library that is unloaded and if that scenario is of > interest to anybody. I see. Thanks. In terms of the specific scenario you describe, is that any different from a conditional breakpoint that refers to a global from an unloaded library? My understanding (and I may be wrong) is that the conditional is not evaluated until the breakpoint is hit. Is it different for a watchpoint? Ah, wait, I think I see -- it's different for a SOFTWARE watchpoint, isn't it?