aboutsummaryrefslogtreecommitdiff
path: root/gdb/irix5-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/irix5-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/irix5-nat.c')
-rw-r--r--gdb/irix5-nat.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c
index de27ef1..a447389 100644
--- a/gdb/irix5-nat.c
+++ b/gdb/irix5-nat.c
@@ -61,13 +61,17 @@ supply_gregset (gregset_t *gregsetp)
for (regi = 0; regi <= CTX_RA; regi++)
supply_register (regi, (char *) (regp + regi) + gregoff);
- supply_register (PC_REGNUM, (char *) (regp + CTX_EPC) + gregoff);
- supply_register (HI_REGNUM, (char *) (regp + CTX_MDHI) + gregoff);
- supply_register (LO_REGNUM, (char *) (regp + CTX_MDLO) + gregoff);
- supply_register (CAUSE_REGNUM, (char *) (regp + CTX_CAUSE) + gregoff);
+ supply_register (mips_regnum (current_gdbarch)->pc,
+ (char *) (regp + CTX_EPC) + gregoff);
+ supply_register (mips_regnum (current_gdbarch)->hi,
+ (char *) (regp + CTX_MDHI) + gregoff);
+ supply_register (mips_regnum (current_gdbarch)->lo,
+ (char *) (regp + CTX_MDLO) + gregoff);
+ supply_register (mips_regnum (current_gdbarch)->cause,
+ (char *) (regp + CTX_CAUSE) + gregoff);
/* Fill inaccessible registers with zero. */
- supply_register (BADVADDR_REGNUM, zerobuf);
+ supply_register (mips_regnum (current_gdbarch)->badvaddr, zerobuf);
}
void
@@ -88,23 +92,24 @@ fill_gregset (gregset_t *gregsetp, int regno)
if ((regno == -1) || (regno == PC_REGNUM))
*(regp + CTX_EPC) =
- extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (PC_REGNUM)],
- DEPRECATED_REGISTER_RAW_SIZE (PC_REGNUM));
+ extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)],
+ DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->pc));
- if ((regno == -1) || (regno == CAUSE_REGNUM))
+ if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->cause))
*(regp + CTX_CAUSE) =
- extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (CAUSE_REGNUM)],
- DEPRECATED_REGISTER_RAW_SIZE (CAUSE_REGNUM));
+ extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->cause)],
+ DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->cause));
- if ((regno == -1) || (regno == HI_REGNUM))
+ if ((regno == -1)
+ || (regno == mips_regnum (current_gdbarch)->hi))
*(regp + CTX_MDHI) =
- extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (HI_REGNUM)],
- DEPRECATED_REGISTER_RAW_SIZE (HI_REGNUM));
+ extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)],
+ DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->hi));
- if ((regno == -1) || (regno == LO_REGNUM))
+ if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->lo))
*(regp + CTX_MDLO) =
- extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (LO_REGNUM)],
- DEPRECATED_REGISTER_RAW_SIZE (LO_REGNUM));
+ extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)],
+ DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->lo));
}
/*
@@ -127,10 +132,12 @@ supply_fpregset (fpregset_t *fpregsetp)
supply_register (FP0_REGNUM + 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? SGI doesn't tell us. */
- supply_register (FCRIR_REGNUM, zerobuf);
+ /* FIXME: how can we supply FCRIR? SGI doesn't tell us. */
+ supply_register (mips_regnum (current_gdbarch)->fp_implementation_revision,
+ zerobuf);
}
void
@@ -151,8 +158,9 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
}
}
- 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)];
}