Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] MIPS: Introduce struct mips_regnums and accessors
Date: Sun, 15 Jun 2003 18:37:00 -0000	[thread overview]
Message-ID: <3EECBCE2.90001@redhat.com> (raw)
In-Reply-To: <1030522201633.ZM31133@localhost.localdomain>


> I have the following objections to the use of offsets:
> 
>     1) They don't work for floating point registers.  (That's assuming
>        that I can convince you that it's desirable to have 16 cooked
>        registers for o32...)  The reason that it won't work is that,
>        e.g, an FPA0_OFFSET will need to have different values for the
>        raw and cooked cases.

I think the MIPS has the following:

- raw registers
These are pretty messed up.  register_raw_size, for instance returns a 
value determined by the ABI.  In theory though, this is just a raw buffer.

- ABI / debug info registers
Currently represented by the virtual registers [sort of].  This is the 
first view onto the raw registers and is ment to provide something that 
the ABI / debug info, rather than ISA, expects.  For o32 there would be 
32 32 bit GPRs and 32 32 bit FPRs.

- cli registers
This is further layer, providing a view into the above raw (and possibly 
ABI) registers.  These are the $registers that the user manipulates from 
the CLI.  Here, having 64 bit word-swapping o32 FPRs would be useful 
(but I don't think their usefulness extends back to the ABI - that would 
result in cross purposes and unnecessary complexity).

I get the feeling here that you're trying to fix the third problem, 
addressing the second as a side effect, while I'm worried about fixing 
the second (improving the third as a side effect).

Re-thinking the problem, and given the above, I think it might be better 
to provide three register maps:

[0 * NUM_REGS .. 1 * NUM_REGS):
The raw register buffer.
[1 * NUM_REGS .. 2 * NUM_REGS):
The ABI registers, mapped onto the raw register set.
[2 * NUM_REGS .. 3 * NUM_REGS):
The CLI register view, mapped onto RAW (also ABI?) registers.
(Perhaps the CLI can steal some of the ABI registers).

It should be possible to brute force the second map (I'll try for a 
patch), and then layer the CLI map onto that and the raw registers.

Andrew


>     2) The conversion from *_REGNUM is much less transparent.
>     3) The use of offsets is more error prone.  There's nothing to
>        prevent you from adding an offset to the wrong boundary start.
>     4) The notation is more cumbersome.
> 
> Furthermore, I really don't understand the problem that you had with
> my proposed layout.  Could you please explain the underlying reasons
> for proposing the offset idea?  E.g, are you concerned about the
> initialization and the maintenance thereof?  Or do you just want to
> present a minimal view of the raw register numbers to clients outside
> of mips-tdep.c?  Or something else altogether?
> 
> Kevin
> 



      reply	other threads:[~2003-06-15 18:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-15 23:51 Kevin Buettner
2003-05-21 19:39 ` Andrew Cagney
2003-05-21 20:40   ` Kevin Buettner
2003-05-22 19:41     ` Andrew Cagney
2003-05-22 20:16       ` Kevin Buettner
2003-06-15 18:37         ` Andrew Cagney [this message]

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=3EECBCE2.90001@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@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