From: Jim Blandy Date: Tue, 4 May 2004 17:58:31 +0000 (+0000) Subject: * config/ppc-tdep.h (struct gdbarch_tdep): Delete X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8bf659e8f6f3cd9041872b77334812bc176bd2e7;p=binutils-gdb.git * config/ppc-tdep.h (struct gdbarch_tdep): Delete 'ppc_gplast_regnum' member. (ppc_num_gprs): New enum constant. * ppc-linux-nat.c (ppc_register_u_addr): Use tdep->ppc_gp0_regnum and ppc_num_gprs instead of tdep->ppc_gplast_regnum. * rs6000-nat.c (regmap, fetch_inferior_registers, store_inferior_registers): Same. * rs6000-tdep.c (e500_pseudo_register_read) (e500_pseudo_register_write): Same. (rs6000_gdbarch_init): Don't initialize tdep->ppc_gplast_regnum. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0352eed4f59..1a403ec1ad1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,16 @@ 2004-05-04 Jim Blandy + * config/ppc-tdep.h (struct gdbarch_tdep): Delete + 'ppc_gplast_regnum' member. + (ppc_num_gprs): New enum constant. + * ppc-linux-nat.c (ppc_register_u_addr): Use tdep->ppc_gp0_regnum + and ppc_num_gprs instead of tdep->ppc_gplast_regnum. + * rs6000-nat.c (regmap, fetch_inferior_registers, + store_inferior_registers): Same. + * rs6000-tdep.c (e500_pseudo_register_read) + (e500_pseudo_register_write): Same. + (rs6000_gdbarch_init): Don't initialize tdep->ppc_gplast_regnum. + * config/rs6000/tm-rs6000.h (FPLAST_REGNUM): Delete #definition. * ppc-tdep.h (ppc_num_fprs): New enum constant. * aix-thread.c (fetch_regs_kernel_thread, fill_fprs, diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index a6ae600b8af..fc8508d64f3 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -132,7 +132,8 @@ ppc_register_u_addr (int regno) int wordsize = sizeof (PTRACE_XFER_TYPE); /* General purpose registers occupy 1 slot each in the buffer */ - if (regno >= tdep->ppc_gp0_regnum && regno <= tdep->ppc_gplast_regnum ) + if (regno >= tdep->ppc_gp0_regnum + && regno < tdep->ppc_gp0_regnum + ppc_num_gprs) u_addr = ((regno - tdep->ppc_gp0_regnum + PT_R0) * wordsize); /* Floating point regs: eight bytes each in both 32- and 64-bit diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h index c8b4100ef2d..4830c5e352d 100644 --- a/gdb/ppc-tdep.h +++ b/gdb/ppc-tdep.h @@ -144,7 +144,6 @@ struct gdbarch_tdep int *regoff; /* byte offsets in register arrays */ const struct reg *regs; /* from current variant */ int ppc_gp0_regnum; /* GPR register 0 */ - int ppc_gplast_regnum; /* GPR register 31 */ int ppc_toc_regnum; /* TOC register */ int ppc_ps_regnum; /* Processor (or machine) status (%msr) */ int ppc_cr_regnum; /* Condition register */ @@ -166,6 +165,7 @@ struct gdbarch_tdep /* Constants for register set sizes. */ enum { + ppc_num_gprs = 32, /* 32 general-purpose registers */ ppc_num_fprs = 32 /* 32 floating-point registers */ }; diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index 3d66e98294b..5628a2eba2c 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -156,7 +156,8 @@ regmap (int regno, int *isfloat) struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); *isfloat = 0; - if (tdep->ppc_gp0_regnum <= regno && regno <= tdep->ppc_gplast_regnum) + if (tdep->ppc_gp0_regnum <= regno + && regno < tdep->ppc_gp0_regnum + ppc_num_gprs) return regno; else if (FP0_REGNUM <= regno && regno < FP0_REGNUM + ppc_num_fprs) { @@ -350,7 +351,7 @@ fetch_inferior_registers (int regno) /* Read 32 general purpose registers. */ for (regno = tdep->ppc_gp0_regnum; - regno <= tdep->ppc_gplast_regnum; + regno < tdep->ppc_gp0_regnum + ppc_num_gprs; regno++) { fetch_register (regno); @@ -389,7 +390,7 @@ store_inferior_registers (int regno) /* Write general purpose registers first. */ for (regno = tdep->ppc_gp0_regnum; - regno <= tdep->ppc_gplast_regnum; + regno < tdep->ppc_gp0_regnum + ppc_num_gprs; regno++) { store_register (regno); diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 721443eeeaf..8a78ff2ac60 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -1669,7 +1669,7 @@ e500_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->ppc_gp0_regnum - && reg_nr <= tdep->ppc_gplast_regnum) + && reg_nr < tdep->ppc_gp0_regnum + ppc_num_gprs) { base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum; @@ -1692,7 +1692,7 @@ e500_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->ppc_gp0_regnum - && reg_nr <= tdep->ppc_gplast_regnum) + && reg_nr < tdep->ppc_gp0_regnum + ppc_num_gprs) { base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum; /* reg_nr is 32 bit here, and base_regnum is 64 bits. */ @@ -2701,7 +2701,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->regs = v->regs; tdep->ppc_gp0_regnum = 0; - tdep->ppc_gplast_regnum = 31; tdep->ppc_toc_regnum = 2; tdep->ppc_ps_regnum = 65; tdep->ppc_cr_regnum = 66; @@ -2746,7 +2745,6 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) break; case bfd_mach_ppc_e500: tdep->ppc_gp0_regnum = 41; - tdep->ppc_gplast_regnum = tdep->ppc_gp0_regnum + 32 - 1; tdep->ppc_toc_regnum = -1; tdep->ppc_ps_regnum = 1; tdep->ppc_cr_regnum = 2;