From: Andrew Cagney <ac131313@cygnus.com>
To: Peter Reilley <micrio@mv.com>
Cc: GDB Discussion <gdb@sources.redhat.com>
Subject: Re: A better register interface
Date: Thu, 15 Feb 2001 18:20:00 -0000 [thread overview]
Message-ID: <3A8C8D34.A33813EE@cygnus.com> (raw)
In-Reply-To: <004a01c097b1$d149bc90$05d145cc@ppro>
Peter Reilley wrote:
>
> I have a request for a feature that I have needed.
> I would like to have a target API that allowed the
> target code to parse the reg name string and return
> the reg value if it existed or an error if it did not
> exist. The same for a write register API.
>
> In the case of the PowerPC, there are SPR registers
> that vary from one processor implementation to another.
> The SPR address space is 2K, but is only sparsely populated.
> Too many to include in NUM_RAW_REGISTERS. If they could be
> created on the fly, the problem would be solved.
> Then, the "info reg" command would only print
> the defined registers but the SPR registers
> would still be accessible.
I would expect your case to be handled roughly as follows:
o NUM_RAW_REGISTERS would cover all
the potential SPR registers.
(2k is nothing :-)
o your target would only suply values
for registers that the CPU really has
(there is already a mechanism for
indicating that a raw register isn't
available).
For instance it might use raw_register_name()
to reverse lookup "spr0" to determine where
in the buffer to put "spr0"'s data.
o core-gdb in conjunction with the cooked
interface would, knowing your CPU's ISA,
just display the SPR registers applicable
to your ISA.
It would use its knowledge of the mapping
between cooked (PSW and raw spr0) and the ABI
to construct the registers you're interested in.
It would consist of roughly:
core-gdb
\
cooked-regs your-target
\ /
raw-regs-buffer
Because there is a clear decoupling between the target and the
cooked-regs, it becomes possible to do things like:
o change the target IF
(for instance the G packet)
with out changing the actual ISA
o change the cooked regs IF
(for instance another CPU)
Andrew
next prev parent reply other threads:[~2001-02-15 18:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-15 16:46 Peter Reilley
2001-02-15 18:20 ` Andrew Cagney [this message]
2001-02-16 6:48 ` Andrew Cagney
-- strict thread matches above, loose matches on Subject: below --
2001-02-14 20:39 Andrew Cagney
2001-02-14 22:17 ` Nick Duffek
2001-02-15 3:37 ` Eli Zaretskii
2001-02-15 7:43 ` Nick Duffek
2001-02-15 18:54 ` Andrew Cagney
2001-02-26 14:01 ` Nick Duffek
2001-02-26 16:05 ` 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=3A8C8D34.A33813EE@cygnus.com \
--to=ac131313@cygnus.com \
--cc=gdb@sources.redhat.com \
--cc=micrio@mv.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