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: [PATCH RFC] Make GNU/Linux/PPC port work again


Michael Snyder wrote:

> > In particular, I was concerned about the following...
> >
> > +/* Some important register numbers. */
> > +
> > +#define        GP0_REGNUM 0            /* GPR register 0 */
> > +#define        TOC_REGNUM 2            /* TOC register */
> > +#define PS_REGNUM 65           /* Processor (or machine) status (%msr) */
> > +#define        CR_REGNUM 66            /* Condition register */
> > +#define        LR_REGNUM 67            /* Link register */
> > +#define        CTR_REGNUM 68           /* Count register */
> > +#define        XER_REGNUM 69           /* Integer exception register */
> > +#define        MQ_REGNUM 70            /* Multiply/Divide extension register */
> >
> > In order to feel comfortable with putting these in a common tm-*.h file,
> > I'd want to prefix the names with PPC_ or somesuch.
> 
> No...
> Every tm.h file that I'm familiar with contains defines
> such as these.  Or at least it did pre-multi-arch.
> Is the PPC multi-arched?  If it is, maybe they need
> to go into the gdbarch struct.  If not, they seem to
> belong in the tm.h file.
> 
> Yeah, I know it is a pain that whenever you touch that file
> your entire build directory recompiles, but it's a fact of
> life in gdb-land.

They don't belong in the multi-arch vector as they are architecture
specific.  As Kevin suggested, a ppc specific header file with PPC
specific prefixes.  When either a non PPC file includes that header or
when a non-ppc specific file tries to use that code directly alarm bells
should go off in peoples heads.

Within ppc-tdep.c, kevin might have:

	gdbarch_set_fp_regnum (...., PPC_FP_REGNUM)

enjoy,
	Andrew

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