Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: Jim Blandy <jimb@redhat.com>
Cc: gdb@sources.redhat.com
Subject: Re: Supplying regsets containing pseudoregisters
Date: Wed, 09 Jun 2004 15:43:00 -0000	[thread overview]
Message-ID: <40C7302D.9020506@gnu.org> (raw)
In-Reply-To: <vt2k6yh8vgi.fsf@zenia.home>

> I think I've run into a design problem in the interaction between the
> "supply" functions that move data from target-specific sources like
> ptrace and core files to the regcache, and the pseudoregister support.
> 
> The job of a regset's "supply" function is to (essentially) call
> regcache_raw_supply on the selected register from the regset, or on
> all the registers in the regset if the register number is -1.
> regcache_raw_supply drops the register's bits into the regcache.
> regcache_raw_supply only allows its callers to supply values of raw
> registers.

FYI, this was a design decision - the low code supplying / collecting 
registers only manipulates the raw register cache.  The old code, which 
tried to implement pseudo-registers in the supply / collect code, didn't 
enforce this, and the result was a mess.

> But sometimes the values in a regset correspond to pseudoregisters.
> For example, on the PowerPC E500, the general-purpose registers are 64
> bits wide, but the E500 doesn't implement the normal PPC 64-bit
> integer instructions; the only instructions which access the upper 32
> bits are special SIMD vector instructions.  GDB represents E500 gprs
> as pseudoregisters stored in the lower halves of the ev0--ev31
> registers, which are raw registers each 64 bits long.  On E500 Linux,
> a gregset_t (as found in a core file, or as handled by libthread_db)
> contains the values of the 32-bit GPRs, not the 64-bit EV registers.
> So the 'supply' function for such a regset has pseudoregister values,
> but because of regcache_raw_supply's interface, it needs to supply raw
> register values.

It sounds like the regcache layout needs to be changed.  I'd break the 
raw EV registers down into hi:lo pairs so that each part can be supplied 
separatly - this appears to more closely reflect the underlying 
implementation.

Andrew



  reply	other threads:[~2004-06-09 15:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-08 23:46 Jim Blandy
2004-06-09 15:43 ` Andrew Cagney [this message]
2004-06-09 17:29   ` Jim Blandy
2004-06-09 21:03     ` Jim Blandy
2004-06-10 16:28       ` Andrew Cagney

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=40C7302D.9020506@gnu.org \
    --to=cagney@gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=jimb@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