From 44ed547b2d1376263f90ccb0abfd707755de08d2 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Sat, 13 Nov 2004 23:40:01 +0000 Subject: * irix5-nat.c (fill_gregset): Replace use of deprecated_registers with equivalent code. (fill_fpregset): Likewise. --- gdb/irix5-nat.c | 47 +++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) (limited to 'gdb/irix5-nat.c') diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index 182a05a..9948d4a 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -83,6 +83,7 @@ fill_gregset (gregset_t *gregsetp, int regno) { int regi; greg_t *regp = &(*gregsetp)[0]; + LONGEST regval; /* Under Irix6, if GDB is built with N32 ABI and is debugging an O32 executable, we have to sign extend the registers to 64 bits before @@ -90,30 +91,39 @@ fill_gregset (gregset_t *gregsetp, int regno) for (regi = 0; regi <= CTX_RA; regi++) if ((regno == -1) || (regno == regi)) - *(regp + regi) = - extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)], - register_size (current_gdbarch, regi)); + { + regcache_raw_read_signed (current_regcache, regi, ®val); + *(regp + regi) = regval; + } if ((regno == -1) || (regno == PC_REGNUM)) - *(regp + CTX_EPC) = - extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)], - register_size (current_gdbarch, mips_regnum (current_gdbarch)->pc)); + { + regcache_raw_read_signed + (current_regcache, mips_regnum (current_gdbarch)->pc, ®val); + *(regp + CTX_EPC) = regval; + } if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->cause)) - *(regp + CTX_CAUSE) = - extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->cause)], - register_size (current_gdbarch, mips_regnum (current_gdbarch)->cause)); + { + regcache_raw_read_signed + (current_regcache, mips_regnum (current_gdbarch)->cause, ®val); + *(regp + CTX_CAUSE) = regval; + } if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->hi)) - *(regp + CTX_MDHI) = - extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)], - register_size (current_gdbarch, mips_regnum (current_gdbarch)->hi)); + { + regcache_raw_read_signed + (current_regcache, mips_regnum (current_gdbarch)->hi, ®val); + *(regp + CTX_MDHI) = regval; + } if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->lo)) - *(regp + CTX_MDLO) = - extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)], - register_size (current_gdbarch, mips_regnum (current_gdbarch)->lo)); + { + regcache_raw_read_signed + (current_regcache, mips_regnum (current_gdbarch)->lo, ®val); + *(regp + CTX_MDLO) = regval; + } } /* @@ -158,15 +168,16 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) { if ((regno == -1) || (regno == regi)) { - from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)]; to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]); - memcpy (to, from, register_size (current_gdbarch, regi)); + regcache_raw_read (current_regcache, regi, to); } } 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)]; + regcache_raw_read (current_regcache, + mips_regnum (current_gdbarch)->fp_control_status, + &fpregsetp->fp_csr); } -- cgit v1.1