Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Richard.Earnshaw@arm.com
Cc: gdb@sources.redhat.com
Subject: Re: ARM and virtual/raw registers
Date: Thu, 09 May 2002 11:52:00 -0000	[thread overview]
Message-ID: <3CDAC55D.1040104@cygnus.com> (raw)
In-Reply-To: <200205091700.SAA02338@cam-mail2.cambridge.arm.com>


>> Hmm, what exactly do you mean by mimicked?  Can the entire register 
>> contents be constructed from information found in the other raw/hardware 
>> registers?  If that is the case then making it a pseudo-register and 
>> using register_{read,write} should do the trick.
>> 
>> (notice - convert-to-virtual free zone).

(and how I'm quietly eliminating it :-)

> In the case where the real register does not exist (arm2, arm3), or when 
> the register doesn't exist in the current operating mode (arm6, arm7 -- 
> though not arm7tdmi, arm8 and sa1 when running in apcs-26 mode), then the 
> CPSR is part of the PC and we mimic its existence within GDB; so yes, in 
> that case it is a virtual register.

> But when we are running in pure apcs-32 mode, then CPSR is a separate 
> register (with additional bits defined).

In APCS-32 mode, is there any overlap of information between it and the PC?

> The more I think about it, the more I think that the raw<->virtual 
> translation is in the wrong part of GDB.  Shouldn't this be part of the 
> Target interface?  Then conversion to/from virtual format would happen as 
> data is passed to/from the inferior, and the rest of GDB would only use 
> the virtual format.

Yes, I agree that raw<->virtual is wrong; but no, it shouldn't be pushed 
down below the target.

> As I understand it, this would clean up the MIPS issue entirely -- when 
> talking to a target that supplies additional bits for a register, the 
> target layer would strip these off/add them back, and the rest of gdb 
> wouldn't have to worry about it.

Have a look at the SH5 patch.  I think this gets it right.

The first cut at all this had the target using supply_register() to fill 
in missing values in from below the cache - turns out this makes 
coherency hard.  The current revision uses register_{read,write} above 
the cache to do this, thus eliminating redundant information in the cache.

For the SH5, the raw register cache contains SHmedia (32/64 bit?) 
registers (as that is what the raw hardware has).  Pseudo-registers, and 
register_{read,write} are then used to map SHcompact (16/32?) registers 
onto the corresponding raw registers.

For instance, the SHcompact PC (I'm going from memory) is constructed 
from two SHmedia registers.  This is implemented by having 
register_{read,write} scatter/gather the relvant value.  Other SHcompact 
registers are sub registers of SHmedia and they are implemented using 
similar techniques.

When it comes to a frame, a custom get_saved_register() handles the 
related problem of SHmedia X SHcompact frame vs request for SHmedia X 
SHcompact register from the next outer frame (I suspect with a few 
lingering edge cases :-).

Andrew




  reply	other threads:[~2002-05-09 18:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-09  7:31 Richard Earnshaw
2002-05-09  9:45 ` Andrew Cagney
2002-05-09 10:01   ` Richard Earnshaw
2002-05-09 11:52     ` Andrew Cagney [this message]
2002-05-10  3:45       ` Richard Earnshaw
2002-05-10  7:48         ` Andrew Cagney
2002-05-10 12:07           ` Andrew Cagney
2002-05-11  7:05             ` Richard Earnshaw
2002-05-11 14:52               ` Andrew Cagney
2002-05-12  7:20                 ` Richard Earnshaw
2002-05-12  8:25                   ` Andrew Cagney
2002-05-12  8:30                     ` Richard Earnshaw
2002-05-12  8:51                       ` Andrew Cagney
2002-05-10  9:29       ` Richard Earnshaw
2002-05-10 11:42         ` Andrew Cagney
2002-05-11  6:16           ` Richard Earnshaw
2002-05-11 11:41           ` Richard Earnshaw
2002-05-11 13:36             ` Andrew Cagney
2002-05-12  7:11               ` Richard Earnshaw
2002-05-12  7:40                 ` Richard Earnshaw
2002-05-12  9:03                   ` Andrew Cagney
2002-05-12 11:31                     ` Andrew Cagney
2002-05-12  8:07                 ` Andrew Cagney
2002-05-12  8:25                   ` Richard Earnshaw
2002-05-12  8:41                     ` Andrew Cagney
2002-05-13  5:35                   ` Richard Earnshaw
2002-05-13  6:13                     ` Andrew Cagney
2002-05-13  6:18                       ` Richard Earnshaw
2002-05-09 10:08 ` Andrew Cagney
2002-05-09 10:36   ` Richard Earnshaw

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=3CDAC55D.1040104@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gdb@sources.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