This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC]: Pseudo-registers for GDB
Eli Zaretskii wrote:
>
> Yes, on all three counts. The problem is how do you tell GDB that
> these registers share the same storage. Various high-level layers of
> GDB are currently not ready for this situation. You need either to
> invoke a target-specific function to update a register, or somehow
> communicate the fact that several registers share the same storage to
> the GDB application level, e.g. by letting the target or the
> architecture specify attributes of each register.
>
So I thought. However, believe it or not, it actually works. I was as
surprised as you probably are.
The gdb for Pentium III (soon to be available on sourceware) defines the
MMX registers as "aliases" of (part) of the FP registers. A few adjusts
in gdb register loop limits and everything works (needs that change on
write_register_bytes() that I posted -- but that won't be needed anymore, I hope).
> > No, as I envision things, GDB would only write the "real"
> > registers back to the target. The "pseudo-registers" would
> > be like internal variables -- computed, not fetched or stored.
> > There would be only one (ten byte) storage location in GDB
> > shared by the FP register and the MMX register. The difference
> > between the two would be only the name and possibly how the
> > data was interpreted.
>
> This should work, but I think there must be a way of telling the
> target-specific part which representation was used to store the data
> in the register, because (at least in the case of MMX) the
> target-specific code might need slight changes in how it passes
> registers back to the inferior, depending on this info.
This may be true for some targets. It is a valid consideration.
But Michaels design allows for the target dependent code to make these
adjustments, if I understood it right.
The Pentium III gdb does not need that though.
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@cygnus.com
2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311
Toronto, Ontario M4P 2C9 Fax: 416-482-6299