Re: [RFA] ppc/rs6000: use gdbarch_ps_regnum

Joel Brobecker
2004-10-16T01:08:29Z

> I just happened to notice this. Gdbarch implements PS_REGNUM,
> so there's no reason to keep it privately in the tdep struct.

> 2004-10-15 Michael Snyder <msnyder@redhat.com>
>
> * ppc-tdep.h (struct gdbarch_tdep): Remove ppc_ps_regnum.
> * rs6000-tdep.c (rs6000_gdbarch_init): Use set_gdbarch_ps_regnum
> instead of putting it in the tdep struct.
> * rs6000-nat.c: Use PS_REGNUM instead of the tdep.
> * ppc-linux-nat.c: Ditto.
> * ppc-linux-tdep.c: Ditto.
> * aix-thread.c: Ditto.

Seems good to me (pretty obvious actually), but I'd prefer it if Kevin
approved it too. Give him a week, and then check it in.

Currently testing on AIX 5.1 right now. Will send the results as soon
as they are available.

One tiny remark:

> *************** rs6000_gdbarch_init (struct gdbarch_info
> *** 3099,3105 ****
>
> tdep->ppc_gp0_regnum = 0;
> tdep->ppc_toc_regnum = 2;
> ! tdep->ppc_ps_regnum = 65;
> tdep->ppc_cr_regnum = 66;
> tdep->ppc_lr_regnum = 67;
> tdep->ppc_ctr_regnum = 68;
> --- 3099,3105 ----
>
> tdep->ppc_gp0_regnum = 0;
> tdep->ppc_toc_regnum = 2;
> ! set_gdbarch_ps_regnum (gdbarch, 65);
> tdep->ppc_cr_regnum = 66;
> tdep->ppc_lr_regnum = 67;
> tdep->ppc_ctr_regnum = 68;

I would personally prefer the set_gdbarch_ps_regnum call to
be moved slightly higher, where we set pc_regnum et al. What
do you think?

--
Joel