diff options
author | Mark Kettenis <kettenis@gnu.org> | 2002-05-06 11:39:51 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2002-05-06 11:39:51 +0000 |
commit | 13e49980455c1ae8c053d85b9ea0f99b364db1f1 (patch) | |
tree | b1fa2c98cb6675b05d62a261de289c8c05f10701 /gdb | |
parent | b9a743c80b8421168c71ea1e55bc4d01bb9f293e (diff) | |
download | gdb-13e49980455c1ae8c053d85b9ea0f99b364db1f1.zip gdb-13e49980455c1ae8c053d85b9ea0f99b364db1f1.tar.gz gdb-13e49980455c1ae8c053d85b9ea0f99b364db1f1.tar.bz2 |
* i387-nat.c (i387_fill_fsave): Use regcache_collect.
(i387_fill_fxsave): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/i387-nat.c | 25 |
2 files changed, 20 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fb6af8e..fc86011 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-05-06 Mark Kettenis <kettenis@gnu.org> + + * i387-nat.c (i387_fill_fsave): Use regcache_collect. + (i387_fill_fxsave): Likewise. + 2002-05-05 Alexandre Oliva <aoliva@redhat.com> * alpha-tdep.c (alpha_extract_return_value): Don't use diff --git a/gdb/i387-nat.c b/gdb/i387-nat.c index 62c26f8..163dcfd 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)); } } |