From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [RFA][branch] Fix DVC calculation for booke ppc
Date: Tue, 05 Apr 2011 19:24:00 -0000 [thread overview]
Message-ID: <1302031479.2511.90.camel@hactar> (raw)
In-Reply-To: <201104051642.p35Gg0Op012678@d06av02.portsmouth.uk.ibm.com>
On Tue, 2011-04-05 at 18:42 +0200, Ulrich Weigand wrote:
> Thiago Jung Bauermann wrotE:
> > The bug was introduced by a patch of mine (doh).
> > ppc-linux-nat.c:calculate_dvc uses the watchpoint length that is passed
> > to target_insert_watchpoint to calculate the contents of the Data Value
> > Compare register. The problem is that for the ranged watchpoints feature
> > I changed GDB to pass 1 as length if the "set powerpc exact-watchpoints"
> > flag is on. This messes up things for calculate_dvc.
> >
> > This patch makes check_condition obtain the length of the watchpoint
> > region from the condition expression, so that it can be passed to
> > calculate_dvc. This works because for a condition to be eligible for
> > hardware acceleration, it needs to have a strict form:
> >
> > (gdb) watch ADDRESS|VARIABLE \
> > if ADDRESS|VARIABLE == CONSTANT EXPRESSION
> >
> > which means that the ADDRESS|VARIABLE part is the same as the watchpoint
> > region.
>
> Huh. That strikes me as a hack to work around another hack :-/
That's one way of looking at it, yes. :-)
> I may have missed some of the discussion behind the current implementation.
> Could you explain again:
>
> - why you're passing an incorrect length of 1 if the "exact watchpoints"
> flag is on?
It's not incorrect, really. An exact watchpoint triggers only when the
first byte of its memory region is accessed. Another way of saying it is
that an exact watchpoint watches a 1-byte memory region at the given
address (or at the address of the given variable).
> - why you're only supporting hardware-accelerated conditions if the length
> is 1?
That is a limitation of BookE processors. You can't make a DVC register
control a ranged watchpoint.
> Note that while you say that the condition needs to have a strict form,
> you don't currently actually *verify* this: if you have a command of the
> form "watch A if B == C", you only verify that A and B *start* at the
> same address -- you really need to also verify that A and B have the
> same length -- but you cannot because the length of A is not available
> to the target since you're always getting 1 for length.
How important is it to enforce that? The "watch A if B == C" case could
occur for a union (watch u.i if u.c == 'a'). It could even be useful in
that situation. Is there a drawback in permitting this?
> It seems to me the "right way" would be for the common parts to always
> pass correct information (address, length, condition, ...) to the target,
> and then for the target to look at the request and choose the best
> possible hardware means to implement this particular request ...
I agree it's the right way, but is the gain worth the wide-reaching
change?
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
next prev parent reply other threads:[~2011-04-05 19:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-05 1:41 Thiago Jung Bauermann
2011-04-05 16:42 ` Ulrich Weigand
2011-04-05 19:24 ` Thiago Jung Bauermann [this message]
2011-04-05 22:51 ` Ulrich Weigand
2011-04-06 3:27 ` Thiago Jung Bauermann
2011-04-15 4:23 ` Thiago Jung Bauermann
2011-04-18 15:30 ` Joel Brobecker
2011-04-18 21:30 ` Thiago Jung Bauermann
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=1302031479.2511.90.camel@hactar \
--to=bauerman@br.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.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