[RFA] ppc: include register numbers in gdbarch_tdep structure.

Andrew Cagney ac131313@cygnus.com
Mon Dec 10 14:34:00 GMT 2001


> 
> Andrew recently said the following:
> 
>     On paper, it should be possible to describe the entire raw regcache 
>     using constants.  I'm finding that, in reality, until all the relevant 
>     framework is fleshed out (eg my regcache breakage, everything 
>     multi-arch) it isn't really possible.  Sigh.
> 
> This suggests to me that someday, though probably not very soon, it
> may indeed be possible to use actual constants.  As you can probably
> tell, I really, really hate the overhead of a function call to provide
> the value of something that ought to be a constant.


Hmm, something else we're doing is moving away from the assumption that 
there is a global current_gdbarch.  Consequently the macro should be 
parameterized vis:

#define PPC_MQ_REGNUM(ARCH) (gdbarch_tdep ((ARCH))->ppc_mq_regnum)

As for other alternatives, I used something like:

{
   const struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   ....
   ... tdep->ppc_mq_regnum ...
   ....
}

in remote.c.  Still, I figure this is all small fish compared to the 
possability of actually fixing GDB's thread and frame code so that more 
than one instance was available and thus we dramatically cut down on the 
number of system / remote calls - which are the real killer.

BTW, even if GDB did support macro's I'd still argue agains them - call 
by name semantics for instance.  They just sux.

enjoy,
Andrew



More information about the Gdb-patches mailing list