From: uweigand Date: Sun, 6 May 2007 14:09:18 +0000 (+0000) Subject: * irix5-nat.c (fill_gregset): Use regcache_raw_collect instead X-Git-Tag: preoverlapped~736 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ce32a292b328f397fe8309fcb74951a7887890af;p=pf3gnuchains%2Fpf3gnuchains4x.git * irix5-nat.c (fill_gregset): Use regcache_raw_collect instead of regcache_raw_read_signed. (fill_fpregset): Use regcache_raw_collect instead of regcache_raw_read. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 754592e364..bd8acfd442 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2007-05-06 Ulrich Weigand + + * irix5-nat.c (fill_gregset): Use regcache_raw_collect instead + of regcache_raw_read_signed. + (fill_fpregset): Use regcache_raw_collect instead of + regcache_raw_read. + 2007-05-03 Kevin Buettner * mips-tdep.c (mips_eabi_push_dummy_call): When pushing floating diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index ff23a9a8a6..184d8cecaf 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -81,9 +81,9 @@ supply_gregset (gregset_t *gregsetp) void fill_gregset (gregset_t *gregsetp, int regno) { - int regi; + int regi, size; greg_t *regp = &(*gregsetp)[0]; - LONGEST regval; + gdb_byte buf[MAX_REGISTER_SIZE]; /* 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 @@ -92,37 +92,41 @@ fill_gregset (gregset_t *gregsetp, int regno) for (regi = 0; regi <= CTX_RA; regi++) if ((regno == -1) || (regno == regi)) { - regcache_raw_read_signed (current_regcache, regi, ®val); - *(regp + regi) = regval; + size = register_size (current_gdbarch, regi); + regcache_raw_collect (current_regcache, regi, buf); + *(regp + regi) = extract_signed_integer (buf, size); } if ((regno == -1) || (regno == PC_REGNUM)) { - regcache_raw_read_signed - (current_regcache, mips_regnum (current_gdbarch)->pc, ®val); - *(regp + CTX_EPC) = regval; + regi = mips_regnum (current_gdbarch)->pc; + size = register_size (current_gdbarch, regi); + regcache_raw_collect (current_regcache, regi, buf); + *(regp + CTX_EPC) = extract_signed_integer (buf, size); } if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->cause)) { - regcache_raw_read_signed - (current_regcache, mips_regnum (current_gdbarch)->cause, ®val); - *(regp + CTX_CAUSE) = regval; + regi = mips_regnum (current_gdbarch)->cause; + size = register_size (current_gdbarch, regi); + regcache_raw_collect (current_regcache, regi, buf); + *(regp + CTX_CAUSE) = extract_signed_integer (buf, size); } - if ((regno == -1) - || (regno == mips_regnum (current_gdbarch)->hi)) + if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->hi)) { - regcache_raw_read_signed - (current_regcache, mips_regnum (current_gdbarch)->hi, ®val); - *(regp + CTX_MDHI) = regval; + regi = mips_regnum (current_gdbarch)->hi; + size = register_size (current_gdbarch, regi); + regcache_raw_collect (current_regcache, regi, buf); + *(regp + CTX_MDHI) = extract_signed_integer (buf, size); } if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->lo)) { - regcache_raw_read_signed - (current_regcache, mips_regnum (current_gdbarch)->lo, ®val); - *(regp + CTX_MDLO) = regval; + regi = mips_regnum (current_gdbarch)->lo; + size = register_size (current_gdbarch, regi); + regcache_raw_collect (current_regcache, regi, buf); + *(regp + CTX_MDLO) = extract_signed_integer (buf, size); } } @@ -178,7 +182,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) if ((regno == -1) || (regno == regi)) { to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]); - regcache_raw_read (current_regcache, regi, to); + regcache_raw_collect (current_regcache, regi, to); } } @@ -192,9 +196,9 @@ fill_fpregset (fpregset_t *fpregsetp, int regno) is 32bits long, while the regcache expects a 64bits long buffer. So we use a buffer of the correct size and copy the register value from that buffer. */ - regcache_raw_read (current_regcache, - mips_regnum (current_gdbarch)->fp_control_status, - fsrbuf); + regcache_raw_collect (current_regcache, + mips_regnum (current_gdbarch)->fp_control_status, + fsrbuf); memcpy (&fpregsetp->fp_csr, fsrbuf + 4, 4); }