From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22698 invoked by alias); 6 Jul 2006 13:20:34 -0000 Received: (qmail 22683 invoked by uid 22791); 6 Jul 2006 13:20:32 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 06 Jul 2006 13:20:28 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FyTmG-00052R-97; Thu, 06 Jul 2006 09:20:20 -0400 Date: Thu, 06 Jul 2006 13:20:00 -0000 From: Daniel Jacobowitz To: Wu Zhou Cc: gdb-patches@sourceware.org Subject: Re: [ppc-linux-nat]: set access flag for h/w watchpoint even if it is only read or write Message-ID: <20060706132020.GB18827@nevyn.them.org> Mail-Followup-To: Wu Zhou , gdb-patches@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11+cvs20060403 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/msg00030.txt.bz2 On Fri, Jun 09, 2006 at 11:40:26PM +0800, Wu Zhou wrote: > Hello all, > > I found a bug in the current ppc-linux h/w watchpoint implementation: > when we set read watchpoint to some expression, if there are any write > operation to it before a read operation is hit, watchpoint_check will see > that its value is changed. So user won't see the watchpoint is hit. > > I make one change to the SET_DEBUGREG operation: even if it is only > read or write watchpoint, we still set access flag. Then, no matter > what operation is on the watched address, a SIGTRAP will be triggered. > The gdb code itself can determine if it is a write operation or read > operation. If it is write, watchpoint_check routine can update the > bs->value to the latest. Eli, you're the most familiar with watchpoint support; do you have any comment on this? I know that we've encountered the same problem on other architectures before (I can't recall exactly when, but I definitely remember Ulrich fixing it for S/390, in the same way). It seems strange to me. Many targets can tell us what sort of watchpoint was hit; we could do something like extend target_stopped_data_address to also return what sort of watchpoint was triggered, if it knows. > - case hw_write: > - /* Set write and translate bits. */ > - dabr_value |= 6; > - break; Wu, I bet you don't really want to change this case. Write watchpoints are the most common, and I think they'll work fine even if they don't trigger on reads - since some platforms can't even trigger on reads. This would be a big slowdown. -- Daniel Jacobowitz CodeSourcery