From: Jim Blandy <jimb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: RFA: remove ppc-tdep.h's struct gdbarch_tdep's ppc_gplast_regnum
Date: Mon, 03 May 2004 22:37:00 -0000 [thread overview]
Message-ID: <vt2ekq1i1lu.fsf@zenia.home> (raw)
2004-05-03 Jim Blandy <jimb@redhat.com>
* 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 ----
next reply other threads:[~2004-05-03 22:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-03 22:37 Jim Blandy [this message]
2004-05-04 15:57 ` Kevin Buettner
2004-05-04 17:58 ` Jim Blandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vt2ekq1i1lu.fsf@zenia.home \
--to=jimb@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox