From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32588 invoked by alias); 4 Dec 2001 11:43:04 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32485 invoked from network); 4 Dec 2001 11:42:50 -0000 Received: from unknown (HELO is.elta.co.il) (199.203.121.2) by sources.redhat.com with SMTP; 4 Dec 2001 11:42:50 -0000 Received: from is (is [199.203.121.2]) by is.elta.co.il (8.9.3/8.8.8) with SMTP id NAA27465; Tue, 4 Dec 2001 13:42:08 +0200 (IST) Date: Tue, 04 Dec 2001 03:43:00 -0000 From: Eli Zaretskii X-Sender: eliz@is To: Orjan Friberg cc: gdb-patches@sources.redhat.com Subject: Re: Hardware watchpoints; dealing with false triggers? In-Reply-To: <3C0CAEAF.E568773E@axis.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2001-12/txt/msg00088.txt.bz2 On Tue, 4 Dec 2001, Orjan Friberg wrote: > > > And this is the key issue: could the interface to the target-specific > > > code be extended to handle the concept of "actual watchpoint address"? > > > > We already have this: it's called target_stopped_data_address. > > breakpoint.c uses this macro to see which watchpoint, if any, > > triggered. > > Also great. Thank you very much for your comments on this, Eli. I need to correct myself: there's a subtle point I forgot to mention. The current code only calls target_stopped_data_address for read and access watchpoints (those set by `rwatch' and `awatch' commands), but not for regular, i.e. data-write, hardware watchpoints (those set by `watch' command). Instead, GDB compares the previous and the current value of the watched expression, and if they differ, it decides that the corresponding watchpoint triggered, without ever considering the address! I think it's a bug to do that with hardware watchpoints (as opposed to software watchpoints), so I'm trying to convince The Powers That Be to change that (in another thread called "Re: [RFC] Possible bug with i386 watchpoints on several targets", which see). But for now, that's how the code works. Sorry I failed to mention that in my original message.