diff options
Diffstat (limited to 'gdb/irix5-nat.c')
-rw-r--r-- | gdb/irix5-nat.c | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index 224d376..a447389 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -55,19 +55,23 @@ supply_gregset (gregset_t *gregsetp) { int regi; greg_t *regp = &(*gregsetp)[0]; - int gregoff = sizeof (greg_t) - MIPS_REGSIZE; + int gregoff = sizeof (greg_t) - mips_regsize (current_gdbarch); static char zerobuf[32] = {0}; 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)]; } @@ -200,8 +208,8 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, { memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size); } - else if (MIPS_REGSIZE == 4 && - core_reg_size == (2 * MIPS_REGSIZE) * NUM_REGS) + else if (mips_regsize (current_gdbarch) == 4 && + core_reg_size == (2 * mips_regsize (current_gdbarch)) * NUM_REGS) { /* This is a core file from a N32 executable, 64 bits are saved for all registers. */ |