From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11459 invoked by alias); 2 Mar 2008 04:24:56 -0000 Received: (qmail 11277 invoked by uid 22791); 2 Mar 2008 04:24:55 -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; Sun, 02 Mar 2008 04:24:35 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 047E898398; Sun, 2 Mar 2008 04:24:34 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id B30769802A; Sun, 2 Mar 2008 04:24:33 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JVfkW-0002lL-Tl; Sat, 01 Mar 2008 23:24:32 -0500 Date: Sun, 02 Mar 2008 04:24:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: gdb-patches@sourceware.org, jimb@red-bean.com Subject: Re: [rfc] Allow watchpoints on inaccessible memory Message-ID: <20080302042432.GA5486@caradoc.them.org> Mail-Followup-To: Eli Zaretskii , gdb-patches@sourceware.org, jimb@red-bean.com References: <20070821142500.GA28295@caradoc.them.org> <20080228161749.GA31695@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-12-11) 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-03/txt/msg00003.txt.bz2 On Fri, Feb 29, 2008 at 12:10:00PM +0200, Eli Zaretskii wrote: > > Date: Thu, 28 Feb 2008 11:17:49 -0500 > > From: Daniel Jacobowitz > > Cc: Eli Zaretskii , Jim Blandy > > > > Eli, is the NEWS entry OK? > > Yes, but I think we should mention this feature in the manual as well. What do you think of the attached? > Btw, are there any command, either CLI or MI, that print the current > value of the watched expression? If there are, we need to fix them > somehow in the case struct value is NULL. No, there are no commands that do this; I checked all the uses of struct breakpoint's val field. > Also, maybe we should display in "info break" in this case, > like we do with breakpoints. That goes in the address field, which we don't use for other watchpoints. And we don't print the current value in info break, so I think this is a full-fledged watchpoint; everything is displayed as if we could read the value. -- Daniel Jacobowitz CodeSourcery 2008-03-01 Daniel Jacobowitz * doc/gdb.texinfo (Set Watchpoints): Mention watchpoints on unreadable memory. Delete obsolete SPARClite reference. Index: doc/gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.471 diff -u -p -r1.471 gdb.texinfo --- doc/gdb.texinfo 28 Feb 2008 16:26:18 -0000 1.471 +++ doc/gdb.texinfo 2 Mar 2008 04:23:36 -0000 @@ -3211,6 +3211,16 @@ expression can use any operators valid i language (@pxref{Languages}). @end itemize +You can set a watchpoint on an expression even if the expression can +not be evaluated yet. For instance, you can set a watchpoint on +@samp{*global_ptr} before @samp{global_ptr} is initialized. +@value{GDBN} will stop when your program sets @samp{global_ptr} and +the expression produces a valid value. If the expression becomes +valid in some other way than changing a variable (e.g.@: if the memory +pointed to by @samp{*global_ptr} becomes readable as the result of a +@code{malloc} call), @value{GDBN} may not stop until the next time +the expression changes. + @cindex software watchpoints @cindex hardware watchpoints Depending on your system, watchpoints may be implemented in software or @@ -3338,17 +3348,6 @@ exhaust the resources available for hard That's because @value{GDBN} needs to watch every variable in the expression with separately allocated resources. -The SPARClite DSU will generate traps when a program accesses some data -or instruction address that is assigned to the debug registers. For the -data addresses, DSU facilitates the @code{watch} command. However the -hardware breakpoint registers can only take two data watchpoints, and -both watchpoints must be the same kind. For example, you can set two -watchpoints with @code{watch} commands, two with @code{rwatch} commands, -@strong{or} two with @code{awatch} commands, but you cannot set one -watchpoint with one command and the other with a different command. -@value{GDBN} will reject the command if you try to mix watchpoints. -Delete or disable unused watchpoint commands before setting new ones. - If you call a function interactively using @code{print} or @code{call}, any watchpoints you have set will be inactive until @value{GDBN} reaches another kind of breakpoint or the call completes.