From: Mark Kettenis Date: Mon, 6 May 2002 11:39:51 +0000 (+0000) Subject: * i387-nat.c (i387_fill_fsave): Use regcache_collect. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=13e49980455c1ae8c053d85b9ea0f99b364db1f1;p=binutils-gdb.git * i387-nat.c (i387_fill_fsave): Use regcache_collect. (i387_fill_fxsave): Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fb6af8eabbb..fc860119818 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-05-06 Mark Kettenis + + * i387-nat.c (i387_fill_fsave): Use regcache_collect. + (i387_fill_fxsave): Likewise. + 2002-05-05 Alexandre Oliva * alpha-tdep.c (alpha_extract_return_value): Don't use diff --git a/gdb/i387-nat.c b/gdb/i387-nat.c index 62c26f8b1b6..163dcfdfcdd 100644 --- a/gdb/i387-nat.c +++ b/gdb/i387-nat.c @@ -116,23 +116,26 @@ i387_fill_fsave (char *fsave, int regnum) if (i >= FPC_REGNUM && i != FIOFF_REGNUM && i != FOOFF_REGNUM) { + char buf[4]; + + regcache_collect (i, buf); + if (i == FOP_REGNUM) { unsigned short oldval, newval; /* The opcode occupies only 11 bits. */ oldval = (*(unsigned short *) (FSAVE_ADDR (fsave, i))); - newval = *(unsigned short *) ®isters[REGISTER_BYTE (i)]; + newval = *(unsigned short *) buf; newval &= ((1 << 11) - 1); newval |= oldval & ~((1 << 11) - 1); memcpy (FSAVE_ADDR (fsave, i), &newval, 2); } else - memcpy (FSAVE_ADDR (fsave, i), ®isters[REGISTER_BYTE (i)], 2); + memcpy (FSAVE_ADDR (fsave, i), buf, 2); } else - memcpy (FSAVE_ADDR (fsave, i), ®isters[REGISTER_BYTE (i)], - REGISTER_RAW_SIZE (i)); + regcache_collect (i, FSAVE_ADDR (fsave, i)); } } @@ -255,13 +258,17 @@ i387_fill_fxsave (char *fxsave, int regnum) if (i >= FPC_REGNUM && i < XMM0_REGNUM && i != FIOFF_REGNUM && i != FDOFF_REGNUM) { + char buf[4]; + + regcache_collect (i, buf); + if (i == FOP_REGNUM) { unsigned short oldval, newval; /* The opcode occupies only 11 bits. */ oldval = (*(unsigned short *) (FXSAVE_ADDR (fxsave, i))); - newval = *(unsigned short *) ®isters[REGISTER_BYTE (i)]; + newval = *(unsigned short *) buf; newval &= ((1 << 11) - 1); newval |= oldval & ~((1 << 11) - 1); memcpy (FXSAVE_ADDR (fxsave, i), &newval, 2); @@ -274,7 +281,7 @@ i387_fill_fxsave (char *fxsave, int regnum) unsigned short ftag; int fpreg; - ftag = *(unsigned short *) ®isters[REGISTER_BYTE (i)]; + ftag = *(unsigned short *) buf; for (fpreg = 7; fpreg >= 0; fpreg--) { @@ -287,12 +294,10 @@ i387_fill_fxsave (char *fxsave, int regnum) memcpy (FXSAVE_ADDR (fxsave, i), &val, 2); } else - memcpy (FXSAVE_ADDR (fxsave, i), - ®isters[REGISTER_BYTE (i)], 2); + memcpy (FXSAVE_ADDR (fxsave, i), buf, 2); } else - memcpy (FXSAVE_ADDR (fxsave, i), ®isters[REGISTER_BYTE (i)], - REGISTER_RAW_SIZE (i)); + regcache_collect (i, FXSAVE_ADDR (fxsave, i)); } }