This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] sim/ppc/sim_calls.c: fix broken REGISTER_NAME call


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]