From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15385 invoked by alias); 3 May 2004 22:37:21 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15377 invoked from network); 3 May 2004 22:37:20 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 3 May 2004 22:37:20 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i43MbKkG027904 for ; Mon, 3 May 2004 18:37:20 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i43MbGv19709; Mon, 3 May 2004 18:37:17 -0400 To: gdb-patches@sources.redhat.com Subject: RFA: remove ppc-tdep.h's struct gdbarch_tdep's ppc_gplast_regnum From: Jim Blandy Date: Mon, 03 May 2004 22:37:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-05/txt/msg00076.txt.bz2 2004-05-03 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. *** gdb/ppc-tdep.h 2004-05-03 16:45:41.000000000 -0500 --- gdb/ppc-tdep.h 2004-05-03 16:47:13.000000000 -0500 *************** *** 144,150 **** 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 */ --- 144,149 ---- *************** *** 166,171 **** --- 165,171 ---- /* Constants for register set sizes. */ enum { + ppc_num_gprs = 32, /* 32 general-purpose registers */ ppc_num_fprs = 32 /* 32 floating-point registers */ }; *** gdb/ppc-linux-nat.c 2004-05-03 16:45:41.000000000 -0500 --- gdb/ppc-linux-nat.c 2004-05-03 16:47:45.000000000 -0500 *************** *** 132,138 **** 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 ) u_addr = ((regno - tdep->ppc_gp0_regnum + PT_R0) * wordsize); /* Floating point regs: eight bytes each in both 32- and 64-bit --- 132,139 ---- 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_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 *** gdb/rs6000-nat.c 2004-05-03 16:45:41.000000000 -0500 --- gdb/rs6000-nat.c 2004-05-03 16:48:25.000000000 -0500 *************** *** 156,162 **** struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); *isfloat = 0; ! if (tdep->ppc_gp0_regnum <= regno && regno <= tdep->ppc_gplast_regnum) return regno; else if (FP0_REGNUM <= regno && regno < FP0_REGNUM + ppc_num_fprs) { --- 156,163 ---- struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); *isfloat = 0; ! 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,356 **** /* Read 32 general purpose registers. */ for (regno = tdep->ppc_gp0_regnum; ! regno <= tdep->ppc_gplast_regnum; regno++) { fetch_register (regno); --- 351,357 ---- /* Read 32 general purpose registers. */ for (regno = tdep->ppc_gp0_regnum; ! regno < tdep->ppc_gp0_regnum + ppc_num_gprs; regno++) { fetch_register (regno); *************** *** 389,395 **** /* Write general purpose registers first. */ for (regno = tdep->ppc_gp0_regnum; ! regno <= tdep->ppc_gplast_regnum; regno++) { store_register (regno); --- 390,396 ---- /* Write general purpose registers first. */ for (regno = tdep->ppc_gp0_regnum; ! regno < tdep->ppc_gp0_regnum + ppc_num_gprs; regno++) { store_register (regno); *** gdb/rs6000-tdep.c 2004-05-03 16:45:41.000000000 -0500 --- gdb/rs6000-tdep.c 2004-05-03 16:49:03.000000000 -0500 *************** *** 1669,1675 **** struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->ppc_gp0_regnum ! && reg_nr <= tdep->ppc_gplast_regnum) { base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum; --- 1669,1675 ---- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->ppc_gp0_regnum ! && reg_nr < tdep->ppc_gp0_regnum + ppc_num_gprs) { base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum; *************** *** 1692,1698 **** struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->ppc_gp0_regnum ! && reg_nr <= tdep->ppc_gplast_regnum) { base_regnum = reg_nr - tdep->ppc_gp0_regnum + tdep->ppc_ev0_regnum; /* reg_nr is 32 bit here, and base_regnum is 64 bits. */ --- 1692,1698 ---- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (reg_nr >= tdep->ppc_gp0_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,2707 **** 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; --- 2701,2706 ---- *************** *** 2746,2752 **** 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; --- 2745,2750 ----