From: Daniel Jacobowitz <drow@false.org>
To: Wu Zhou <woodzltc@cn.ibm.com>
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
Date: Thu, 06 Jul 2006 13:20:00 -0000 [thread overview]
Message-ID: <20060706132020.GB18827@nevyn.them.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0606092320510.5286@localhost.localdomain>
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
next prev parent reply other threads:[~2006-07-06 13:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-09 15:40 Wu Zhou
2006-06-23 0:44 ` [RFC]: h/w watchpoint (r,w,a) for ppc440 Wu Zhou
2006-07-06 13:20 ` Daniel Jacobowitz [this message]
2006-07-06 20:59 ` [ppc-linux-nat]: set access flag for h/w watchpoint even if it is only read or write Eli Zaretskii
2006-07-06 21:37 ` Daniel Jacobowitz
2006-07-07 4:35 Wu Zhou
2006-07-07 10:04 ` Eli Zaretskii
2006-07-07 13:18 ` Daniel Jacobowitz
2006-07-07 15:08 ` Eli Zaretskii
2006-07-08 19:36 ` Ulrich Weigand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060706132020.GB18827@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=woodzltc@cn.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox