From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24040 invoked by alias); 8 Jun 2008 18:05:59 -0000 Received: (qmail 24030 invoked by uid 22791); 8 Jun 2008 18:05:58 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout1.012.net.il (HELO mtaout1.012.net.il) (84.95.2.1) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 08 Jun 2008 18:05:39 +0000 Received: from HOME-C4E4A596F7 ([80.230.28.131]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0K2500I0GPKTZIQ0@i-mtaout1.012.net.il> for gdb-patches@sourceware.org; Sun, 08 Jun 2008 21:19:42 +0300 (IDT) Date: Sun, 08 Jun 2008 18:05:00 -0000 From: Eli Zaretskii Subject: Re: [patch] Warn on constant value watchpoints In-reply-to: <20080608155302.GA25486@host0.dyn.jankratochvil.net> X-012-Sender: halo1@inter.net.il To: Jan Kratochvil Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: Content-transfer-encoding: 7BIT References: <20080608155302.GA25486@host0.dyn.jankratochvil.net> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00140.txt.bz2 > Date: Sun, 8 Jun 2008 17:53:02 +0200 > From: Jan Kratochvil > > > --tKW2IUtsqtDRztdT > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > > Hi, > > idea came from a discussion with the Firefox maintainer Martin Stransky who had > disfunctional watchpoint on the address of a variable: > > (gdb) watch 0x4343548 > Watchpoint 1: 70530376 Should we allow such watchpoints? under what circumstances are they useful? > + if (v == NULL && !query > + (_("Do you insist on this watchpoint with a constant value? "))) I think a better text for this question would be Really watch constant value %s? > +If you watch for a change in a numerically entered address you need to > +dereference it as the address itself is just a constant number which will never > +change: > + > +@smallexample > +(@value{GDBP}) watch 0x600850 > +Do you insist on this watchpoint with a constant value? (y or n) n > +Watchpoint with a constant value was cancelled. > +(@value{GDBP}) watch *(int *) 0x600850 > +Watchpoint 1: *(int *) 6293584 > +@end smallexample Thanks, but please mention in the text that GDB asks for confirmation because watching a constant value is not generally useful. Otherwise, the example might not be fully understood. Other than that, the patch for the manual is approved (assuming the code is approved).