aboutsummaryrefslogtreecommitdiff
path: root/gdb/mipsv4-nat.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-11-16 19:24:05 +0000
committerAndrew Cagney <cagney@redhat.com>2003-11-16 19:24:05 +0000
commit56cea623828ea5eea0cc592f7f55157b4b902bb4 (patch)
tree82c70cf0ac60b3dd7337465ef6f42739d704f633 /gdb/mipsv4-nat.c
parent719ec22109a4b447266214fadba2fbb878192c96 (diff)
downloadgdb-56cea623828ea5eea0cc592f7f55157b4b902bb4.zip
gdb-56cea623828ea5eea0cc592f7f55157b4b902bb4.tar.gz
gdb-56cea623828ea5eea0cc592f7f55157b4b902bb4.tar.bz2
2003-11-16 Andrew Cagney <cagney@redhat.com>
* mips-tdep.c (struct gdbarch_tdep): Add field "regnum". (mips_fpa0_regnum, mips_regnum): New function. (mips_gdbarch_init): Fill in the "regnum" fields. * mips-tdep.h (struct mips_regnum): Define. (mips_regnum): Declare. * config/mips/tm-mips.h (BADVADDR_REGNUM): Delete macro. (LO_REGNUM, HI_REGNUM, BADVADDR_REGNUM): Ditto. (CAUSE_REGNUM, PC_REGNUM, FP0_REGNUM): Ditto. (FCRCS_REGNUM, FCRIR_REGNUM, FPA0_REGNUM): Ditto. * config/mips/tm-irix6.h (FP0_REGNUM): Delete macro. (PC_REGNUM, CAUSE_REGNUM, BADVADDR_REGNUM): Ditto. (HI_REGNUM, LO_REGNUM, FCRCS_REGNUM, FCRIR_REGNUM): Ditto. * config/mips/tm-irix5.h (FP0_REGNUM): Delete macro. (PC_REGNUM, CAUSE_REGNUM, BADVADDR_REGNUM): Ditto. (HI_REGNUM, LO_REGNUM, FCRCS_REGNUM, FCRIR_REGNUM): Ditto. * remote-mips.c: Include "mips-tdep.h". Update. * mipsnbsd-tdep.c: Update. * mipsv4-nat.c: Update. * mips-tdep.c: Update. * mips-nat.c: Update. * mips-linux-tdep.c: Update. * mips-linux-nat.c: Update. * irix5-nat.c: Update. * dve3900-rom.c: Include "mips-tdep.h". Update. (ignore_packet): Supress GCC warning. * config/mips/nm-riscos.h: Update. * Makefile.in (dve3900-rom.o, remote-mips.o): Update dependencies.
Diffstat (limited to 'gdb/mipsv4-nat.c')
-rw-r--r--gdb/mipsv4-nat.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/gdb/mipsv4-nat.c b/gdb/mipsv4-nat.c
index 686d256..3a3e732 100644
--- a/gdb/mipsv4-nat.c
+++ b/gdb/mipsv4-nat.c
@@ -53,14 +53,18 @@ supply_gregset (gregset_t *gregsetp)
for (regi = 0; regi <= CXT_RA; regi++)
supply_register (regi, (char *) (regp + regi));
- supply_register (PC_REGNUM, (char *) (regp + CXT_EPC));
- supply_register (HI_REGNUM, (char *) (regp + CXT_MDHI));
- supply_register (LO_REGNUM, (char *) (regp + CXT_MDLO));
- supply_register (CAUSE_REGNUM, (char *) (regp + CXT_CAUSE));
+ supply_register (mips_regnum (current_gdbarch)->pc,
+ (char *) (regp + CXT_EPC));
+ supply_register (mips_regnum (current_gdbarch)->hi,
+ (char *) (regp + CXT_MDHI));
+ supply_register (mips_regnum (current_gdbarch)->lo,
+ (char *) (regp + CXT_MDLO));
+ supply_register (mips_regnum (current_gdbarch)->cause,
+ (char *) (regp + CXT_CAUSE));
/* Fill inaccessible registers with zero. */
supply_register (PS_REGNUM, zerobuf);
- supply_register (BADVADDR_REGNUM, zerobuf);
+ supply_register (mips_regnum (current_gdbarch)->badvaddr, zerobuf);
supply_register (DEPRECATED_FP_REGNUM, zerobuf);
supply_register (UNUSED_REGNUM, zerobuf);
for (regi = FIRST_EMBED_REGNUM; regi <= LAST_EMBED_REGNUM; regi++)
@@ -77,22 +81,22 @@ fill_gregset (gregset_t *gregsetp, int regno)
if ((regno == -1) || (regno == regi))
*(regp + regi) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
- if ((regno == -1) || (regno == PC_REGNUM))
- *(regp + CXT_EPC) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)];
+ if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->pc))
+ *(regp + CXT_EPC) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)];
- if ((regno == -1) || (regno == CAUSE_REGNUM))
- *(regp + CXT_CAUSE) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (CAUSE_REGNUM)];
+ if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->cause))
+ *(regp + CXT_CAUSE) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->cause)];
- if ((regno == -1) || (regno == HI_REGNUM))
- *(regp + CXT_MDHI) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (HI_REGNUM)];
+ if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->hi))
+ *(regp + CXT_MDHI) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)];
- if ((regno == -1) || (regno == LO_REGNUM))
- *(regp + CXT_MDLO) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (LO_REGNUM)];
+ if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->lo))
+ *(regp + CXT_MDLO) = *(greg_t *) & deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)];
}
/*
* Now we do the same thing for floating-point registers.
- * We don't bother to condition on FP0_REGNUM since any
+ * We don't bother to condition on FP0 regnum since any
* reasonable MIPS configuration has an R3010 in it.
*
* Again, see the comments in m68k-tdep.c.
@@ -106,13 +110,15 @@ supply_fpregset (fpregset_t *fpregsetp)
memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = 0; regi < 32; regi++)
- supply_register (FP0_REGNUM + regi,
+ supply_register (mips_regnum (current_gdbarch)->fp0 + regi,
(char *) &fpregsetp->fp_r.fp_regs[regi]);
- supply_register (FCRCS_REGNUM, (char *) &fpregsetp->fp_csr);
+ supply_register (mips_regnum (current_gdbarch)->fp_control_status,
+ (char *) &fpregsetp->fp_csr);
- /* FIXME: how can we supply FCRIR_REGNUM? The ABI doesn't tell us. */
- supply_register (FCRIR_REGNUM, zerobuf);
+ /* FIXME: how can we supply FCRIR? The ABI doesn't tell us. */
+ supply_register (mips_regnum (current_gdbarch)->fp_implementation_revision,
+ zerobuf);
}
void
@@ -121,18 +127,20 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
int regi;
char *from, *to;
- for (regi = FP0_REGNUM; regi < FP0_REGNUM + 32; regi++)
+ for (regi = mips_regnum (current_gdbarch)->fp0;
+ regi < mips_regnum (current_gdbarch)->fp0 + 32; regi++)
{
if ((regno == -1) || (regno == regi))
{
from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
- to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
+ to = (char *) &(fpregsetp->fp_r.fp_regs[regi - mips_regnum (current_gdbarch)->fp0]);
memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regi));
}
}
- if ((regno == -1) || (regno == FCRCS_REGNUM))
- fpregsetp->fp_csr = *(unsigned *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (FCRCS_REGNUM)];
+ if ((regno == -1)
+ || (regno == mips_regnum (current_gdbarch)->fp_control_status))
+ fpregsetp->fp_csr = *(unsigned *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)];
}