Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Ulrich Weigand <uweigand@de.ibm.com>, gdb-patches@sourceware.org
Subject: Re: [rfc][4/13] Eliminate read_register: read_register in 	deprecated_mips_set_processor_regs_hack
Date: Tue, 12 Jun 2007 14:19:00 -0000	[thread overview]
Message-ID: <20070612142003.GG7815@caradoc.them.org> (raw)
In-Reply-To: <Pine.LNX.4.64N.0706081323450.2732@blysk.ds.pg.gda.pl>

On Fri, Jun 08, 2007 at 01:27:56PM +0100, Maciej W. Rozycki wrote:
> > (Not sure if this is still required, or if it could be replaced by
> > the new XML register mechanism ...)
> 
>  Well, if the latter provides similar means.  I have extensive changes 
> pending for deprecated_mips_set_processor_regs_hack() and this access 
> definitely has to stay.

In the new GDB scheme for such things, a processor with different
register names should be a different gdbarch.  The XML descriptions
are just one way of specifying a new architecture variant and which
variant to use - there are other ways, too.  I would recommend a look
at remote_read_description, which provides another way that is closer
to what you need here.

It's not a perfect fit, though.  What
deprecated_mips_set_processor_regs_hack could be doing is waiting
until the point where we know the architecture well enough to find the
PRID register contents, and then selecting a variant of the
architecture based on that PRID value.  But we do not know the
register layout yet at the point of target_read_description; we don't
know which registers are provided or how big they are.

I don't have an easy answer for this.  Simplest would be to keep it
local to remote-mips.c (as it currently is), but change how it works;
move it from common_open to a new remote_mips_read_description, fetch
the PRID without going through GDB's register cache at all, and then
create an appropriate target description which specifies the processor
based on the PRID.  It would be nicer if we could make it work for
remote.c too though.

Of course you can also make any remote MIPS targets respond with XML
<architecture> tags :-)

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2007-06-12 14:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-07 20:58 Ulrich Weigand
2007-06-08 12:28 ` Maciej W. Rozycki
2007-06-12 14:19   ` Daniel Jacobowitz [this message]
2007-06-12 14:50     ` Maciej W. Rozycki
2007-06-12 15:05       ` Daniel Jacobowitz

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=20070612142003.GG7815@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@linux-mips.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