From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12349 invoked by alias); 21 Aug 2007 23:17:07 -0000 Received: (qmail 12118 invoked by uid 22791); 21 Aug 2007 23:17:05 -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; Tue, 21 Aug 2007 23:17:00 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id AB19B980C1 for ; Tue, 21 Aug 2007 23:17:00 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 0B186980C0 for ; Tue, 21 Aug 2007 23:16:59 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1INcy1-0006Dq-1d for gdb-patches@sourceware.org; Tue, 21 Aug 2007 19:16:57 -0400 Date: Tue, 21 Aug 2007 23:17:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Subject: Re: [rfc] Allow watchpoints on inaccessible memory Message-ID: <20070821231657.GA23667@caradoc.them.org> Mail-Followup-To: gdb-patches@sourceware.org References: <20070821142500.GA28295@caradoc.them.org> <20070821180630.GA8332@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.15 (2007-04-09) 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: 2007-08/txt/msg00423.txt.bz2 On Tue, Aug 21, 2007 at 03:49:06PM -0700, Jim Blandy wrote: > This change could be generalized, although I'm not sure it's worth it. > In evaluating an expression like p->q->r->s, if p->q is an invalid > address, we could set a hardware watchpoint on p->q. In other words, > watching the values produced by a failing expression up to the point > of failure would allow us to use hardware watchpoints whenever > possible. As it stands, your patch will record NULL as that > watchpoint's value, and single-step to watch for changes. No, that's not true. It will find the memory references that were un-lazied and wait for their values to change. In your example that will be p and p->q but the value will be NULL because evaluation didn't finish. > A lot of this rationale was not obvious to me by a long shot; I spent > about an hour working it all out. I think the patch needs more > comments. If you'd like me to write them, just say the word; I like > writing docs. I don't understand what subtleties you've found, to be honest. The approach is a simple extension of what was already there; I think you're inventing some of the complexity :-) You're welcome to add comments if you prefer though. -- Daniel Jacobowitz CodeSourcery