Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Cc: Pedro Alves <palves@redhat.com>
Subject: Re: [PATCH] Don't attach to 'target_changed' observer in regcache
Date: Thu, 02 Aug 2012 15:40:00 -0000	[thread overview]
Message-ID: <9087332.baeLaisSVj@qiyao.dyndns.org> (raw)
In-Reply-To: <501A92B5.4070302@redhat.com>

On Thursday, August 02, 2012 03:46:13 PM Pedro Alves wrote:
> Really not sure about this.  There were also comments from Dan and Cagney
> on that thread, that point at need for this being not that uncommon.
> 
> E.g. Dan wrote:
> > I've been meaning to do this for a long time.  For instance, there is a
> > writeable register on PowerPC targets which has some read-only bits.
> > Right now, if you set it to an arbitrary value and then print it you'll
> > get the value GDB wrote - not the value that was actually accepted into
> > the register.
> > 
> > Andrew convinced me that the performance cost associated with this
> > would be small in practice.
> 

I red Dan's comment, but I thought it is uncommon :)

> I think you get to argue against the whole picture, not just Orjan's
> port, although I think we'd also need a plan to address the original
> issue in some other way.  E.g., I can picture that gdb might not even
> have any knowledge of such registers (so no way to hardcode when-to-flush
> in the backend), as they may have been included as part of a target
> description, in addition to core registers.

It is a good idea to extend target description for the attributes of each 
register, for example, a certain bit of a register is read-only.  However, 
target description can't handle Orjan's requirement (changing the bank select 
register changes the contents for a whole set of other registers.).

My original thought is to extend observer 'target_changed' to pass more 
parameters, such as 'register number', and backend registers its own hook to 
'target_changed' observer, and takes right actions for the "interesting" 
register changes.  Maybe we can do this via gdbarch hook.

THe problem is clear, but its description is not very precise.  I don't have a 
solid plan so far.

-- 
Yao (齐尧)


  reply	other threads:[~2012-08-02 15:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02  7:17 Yao Qi
2012-08-02 14:46 ` Pedro Alves
2012-08-02 15:40   ` Yao Qi [this message]
2012-08-08 17:54 ` Mark Kettenis
2012-08-09  3:11   ` Yao Qi
2012-08-09  8:12     ` Mark Kettenis
2012-08-09  8:37       ` Yao Qi
2012-08-21 19:39         ` Pedro Alves

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=9087332.baeLaisSVj@qiyao.dyndns.org \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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