From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: "gdb ml" <gdb@sourceware.org>,
"Luis Machado" <luisgpm@linux.vnet.ibm.com>,
"Sérgio Durigan Júnior" <sergiodj@linux.vnet.ibm.com>
Subject: Re: support for BookE hardware debug features
Date: Tue, 03 Mar 2009 19:32:00 -0000 [thread overview]
Message-ID: <1236108731.30573.58.camel@localhost.localdomain> (raw)
In-Reply-To: <20090302205516.GF3632@adacore.com>
El lun, 02-03-2009 a las 12:55 -0800, Joel Brobecker escribió:
> > - support for the two DVCs (Data Value Compare), which enable
> > hardware-accelerated conditions for hardware watchpoints,
>
> This sounds like an interesting feature. Certain versions of VxWorks
> now come with a feature that's slightly comparable. I don't believe
> that the target really had DVC, but the kernel made it look that way.
> The purpose is to avoid having a lot of communication between the
> debugger and the target when the hardware value check is a simple 32bit
> value compare.
Nice to know that there are other targets with a similar feature.
> > We don't know yet how we'll extend gdb commands to express the ranged
> > breakpoints and watchpoints, and the DVCs. For the latter maybe we can
> > add some intelligence to use the registers if the condition expression
> > is simple enough, I didn't think much about this yet.
>
> When I looked at extending GDB for this, the feedback I got from the
> users is that they didn't want to have a special syntax to activate
> the feature. So I had to hack into condition evaluation code to
> add a target-specific feature that would inspect the expression tree
> and identify simple cases where DVC could be used.
>
> It wasn't all that pretty, but it remained a reasonable approach
> because we restricted ourselves to a selected number of expressions:
>
> (gdb) watch *<address> if *<address> BINOP_EQUAL <litteral>
> (gdb) watch <variable> if <variable> BINOP_EQUAL <litteral>
>
> For illustration, I fished the code out from one of our old trees.
> I'm not sure whether this is really a viable approach for you or not.
> The thing is, I don't see any other except maybe formalizing a little
> bit more how DVC would work and push some of the tree-inspection code
> up in the core.
I was thinking about something along those lines too. Possibly adding a
target hook which would receive a struct expression with the condition
and a watchpoint address, and return true if it can be
hardware-accelerated. That hook would also set up the hardware debug
registers accordingly.
Since there is at least one other target (VxWorks, as you say) which
would also benefit from the hook, this seems to be a good option, what
do you think?
Regarding what is a viable approach, our main concern is that we do it
in a way which will be accepted upstream.
> static int
> watch_star_address_if_star_address_equal_literal_p (struct breakpoint *b,
> TGT_ARG_T *data_value)
Thanks for sharing this code, by the way. Just a question to be on the
safe side: is there any copyright implication if we stare at it for too
long (half-joking)?
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
next prev parent reply other threads:[~2009-03-03 19:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-02 20:39 Thiago Jung Bauermann
2009-03-02 20:55 ` Joel Brobecker
2009-03-03 19:32 ` Thiago Jung Bauermann [this message]
2009-03-03 21:33 ` Joel Brobecker
2009-05-24 19:39 ` Thiago Jung Bauermann
2009-05-25 19:20 ` Sérgio Durigan Júnior
2009-05-26 14:28 ` 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=1236108731.30573.58.camel@localhost.localdomain \
--to=bauerman@br.ibm.com \
--cc=brobecker@adacore.com \
--cc=gdb@sourceware.org \
--cc=luisgpm@linux.vnet.ibm.com \
--cc=sergiodj@linux.vnet.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