aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-10-11 20:03:55 +0000
committerMark Kettenis <kettenis@gnu.org>2004-10-11 20:03:55 +0000
commit3303a2761a3f8b2c2a9e1c683a5f43fae5625be3 (patch)
tree1d9f8e13266a032fd7f940db1c6fb8a9cc525272
parent653cfe8544fcfa851946baa338fed32c71567def (diff)
downloadbinutils-3303a2761a3f8b2c2a9e1c683a5f43fae5625be3.zip
binutils-3303a2761a3f8b2c2a9e1c683a5f43fae5625be3.tar.gz
binutils-3303a2761a3f8b2c2a9e1c683a5f43fae5625be3.tar.bz2
* i386gnu-nat.c: Include "gdb_string.h".
(fetch_fpregs): Use i387_supply_fxsave to fill the floating-point registers when the floating-point state isn't initialized. * Makefile.in (i386gnu-nat.o): Update dependencies.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/Makefile.in4
-rw-r--r--gdb/i386gnu-nat.c23
3 files changed, 20 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 94c5182..a3d72d1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2004-10-11 Mark Kettenis <kettenis@gnu.org>
+
+ * i386gnu-nat.c: Include "gdb_string.h".
+ (fetch_fpregs): Use i387_supply_fxsave to fill the floating-point
+ registers when the floating-point state isn't initialized.
+ * Makefile.in (i386gnu-nat.o): Update dependencies.
+
2004-10-11 David Anderson <davea@sgi.com>
* regcache.c (regcache_raw_read): Comment was missing "to".
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 59c81c8..51fa3ce 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2004,8 +2004,8 @@ i386fbsd-nat.o: i386fbsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \
i386fbsd-tdep.o: i386fbsd-tdep.c $(defs_h) $(arch_utils_h) $(osabi_h) \
$(i386_tdep_h) $(i387_tdep_h) $(solib_svr4_h)
i386gnu-nat.o: i386gnu-nat.c $(defs_h) $(inferior_h) $(floatformat_h) \
- $(regcache_h) $(gdb_assert_h) $(i386_tdep_h) $(gnu_nat_h) \
- $(i387_tdep_h) $(gregset_h)
+ $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(i386_tdep_h) \
+ $(gnu_nat_h) $(i387_tdep_h) $(gregset_h)
i386gnu-tdep.o: i386gnu-tdep.c $(defs_h) $(osabi_h) $(i386_tdep_h)
i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \
$(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index f694eba..023fbb7 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -28,6 +28,7 @@
#include "gdb_assert.h"
#include <errno.h>
#include <stdio.h>
+#include "gdb_string.h"
#include <mach.h>
#include <mach_error.h>
@@ -60,8 +61,9 @@ static int reg_offset[] =
#define REG_ADDR(state, regnum) ((char *)(state) + reg_offset[regnum])
-/* Get the whole floating-point state of THREAD and record the
- values of the corresponding (pseudo) registers. */
+/* Get the whole floating-point state of THREAD and record the values
+ of the corresponding (pseudo) registers. */
+
static void
fetch_fpregs (struct proc *thread)
{
@@ -79,18 +81,15 @@ fetch_fpregs (struct proc *thread)
}
if (!state.initialized)
- /* The floating-point state isn't initialized. */
{
- int i;
-
- for (i = FP0_REGNUM; i <= FOP_REGNUM; i++)
- regcache_raw_supply (current_regcache, i, NULL);
-
- return;
+ /* The floating-point state isn't initialized. */
+ i387_supply_fsave (current_regcache, -1, NULL);
+ }
+ else
+ {
+ /* Supply the floating-point registers. */
+ i387_supply_fsave (current_regcache, -1, state.hw_state);
}
-
- /* Supply the floating-point registers. */
- i387_supply_fsave (current_regcache, -1, state.hw_state);
}
#ifdef HAVE_SYS_PROCFS_H