From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20699 invoked by alias); 12 Jul 2006 18:15:52 -0000 Received: (qmail 20688 invoked by uid 22791); 12 Jul 2006 18:15:51 -0000 X-Spam-Check-By: sourceware.org Received: from nitzan.inter.net.il (HELO nitzan.inter.net.il) (192.114.186.20) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 12 Jul 2006 18:15:50 +0000 Received: from HOME-C4E4A596F7 (IGLD-83-130-194-234.inter.net.il [83.130.194.234]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id ECZ03222 (AUTH halo1); Wed, 12 Jul 2006 21:15:42 +0300 (IDT) Date: Wed, 12 Jul 2006 18:15:00 -0000 Message-Id: From: Eli Zaretskii To: Wu Zhou , gdb-patches@sourceware.org In-reply-to: <20060712173125.GC24622@nevyn.them.org> (message from Daniel Jacobowitz on Wed, 12 Jul 2006 13:31:25 -0400) Subject: Re: Fw: [ppc-linux-nat]: set access flag for h/w watchpoint even if it is only read or write (fwd) Reply-to: Eli Zaretskii References: <20060711110910.6298fq7oys0gwogw@imap.linux.ibm.com> <20060712173125.GC24622@nevyn.them.org> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00118.txt.bz2 > Date: Wed, 12 Jul 2006 13:31:25 -0400 > From: Daniel Jacobowitz > Cc: eliz@gnu.org, gdb-patches@sourceware.org > > First, there's the question of targets which can't set true "read" > watchpoints, but can set "access" watchpoints. Right now the x86 > simply accepts a request to insert a read watchpoint, and generates an > access watchpoint instead. How about if we changed it to refuse to > insert read watchpoints, changed breakpoint.c to attempt an access > watchpoint if inserting a read watchpoint fails, and then store in the > breakpoint which type was inserted? Sorry, I don't understand your plan. How is it different from what GDB does now (silently replace read with access watchpoint)? And what type will we store when the user says "rwatch"? > Second, there's the question of which sort of watchpoint we've hit. If > the target could tell us, say, as a return value from > target_stopped_data_address, then we could only check read watchpoints > when a read watchpoint triggers. But I think this is a smaller issue; > at worst we might report that both a write and read watchpoint had > triggered when really only a write watchpoint had. I think this is bad: if a user sets two different watchpoints at the same address, she wants each watchpoint to fire when its specific conditions are met. My philosophy here is that watchpoints are a kind of silver bullet: you use them when you have almost no idea who could touch the data in question. So watchpoints should perform as close to the spec as possible, because the user is already in a very confused state; confusing her even more with imprecise watch reports would be a bad mantra, IMO. > And there's corner > cases, like instructions which both read and write an address; they > should trigger both read and write watchpoints but I doubt any platform > gives us enough information to figure out that that's happened. In those cases, it is okay to show both watchpoints, or even just the write one.