This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] sim/ppc/sim_calls.c: fix broken REGISTER_NAME call
- To: Stan Shebs <shebs at apple dot com>
- Subject: Re: [RFA] sim/ppc/sim_calls.c: fix broken REGISTER_NAME call
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Thu, 07 Dec 2000 11:23:41 +1100
- Cc: Michael Elizabeth Chastain <chastain at cygnus dot com>,gdb-patches at sourceware dot cygnus dot com, jimb at cygnus dot com
- References: <200012061747.JAA25758@train2.cygnus.com> <3A2E7C9A.7C047632@apple.com>
Stan Shebs wrote:
>
> Michael Elizabeth Chastain wrote:
> >
> > Now that the ppc is multi-arched, REGISTER_NAME does not work in the
> > simulator (specifically, the sim code does not see gdb's "config.h"
> > file, so it does not get the right value of GDB_MULTI_ARCH). This patch
> > changes the ppc simulator to call gdbarch_register_name directly.
>
> Probably I didn't get the memo, but how is this supposed to work for
> the standalone simulator?
The PPC simulator does a convoluted backflip.
gdb calls fetch/store register (regnr)
a sim/ppc wrapper converts regnr to a regname
the wrapper calls real fetch/store register (regname)
------ snip -----
the real fetch/store register (regname) looks up
the name in an internal database and uses that to determine
where to write the register.
So the real register write interface is an extra level in. I suspect it
is also going to be far more robust than the other simulators which are
relying on magic numbers.
So, yes, the change is approved.
Andrew