aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-04-09 23:24:05 +0000
committerMark Kettenis <kettenis@gnu.org>2004-04-09 23:24:05 +0000
commitf0ef85a5af6ee9a1ee2a66026582cbfda57a3379 (patch)
treec1eaa5cc65dae60c2da96ce1cac8ae7876371c16
parentd9f8c85b8e4983b7a62abf5affa8030bcfee692e (diff)
downloadgdb-f0ef85a5af6ee9a1ee2a66026582cbfda57a3379.zip
gdb-f0ef85a5af6ee9a1ee2a66026582cbfda57a3379.tar.gz
gdb-f0ef85a5af6ee9a1ee2a66026582cbfda57a3379.tar.bz2
* amd64-tdep.c (amd64_supply_fxsave): Only fiddle with
I387_FISEG_REGNUM and I387_FOSEG_REGNUM in 64-bit mode. (amd64_collect_fxsave): Likewise.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/amd64-tdep.c13
2 files changed, 12 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 764a05c..6522015 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2004-04-10 Mark Kettenis <kettenis@gnu.org>
+ * amd64-tdep.c (amd64_supply_fxsave): Only fiddle with
+ I387_FISEG_REGNUM and I387_FOSEG_REGNUM in 64-bit mode.
+ (amd64_collect_fxsave): Likewise.
+
* i386-sol2-tdep.c: Include "gdb_string.h".
(i386_sol2_sigtramp_p): Recognize signal trampoline based on its
name.
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 0bec555..d165714 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -1171,7 +1171,7 @@ amd64_supply_fxsave (struct regcache *regcache, int regnum,
{
i387_supply_fxsave (regcache, regnum, fxsave);
- if (fxsave)
+ if (fxsave && gdbarch_ptr_bit (get_regcache_arch (regcache)) == 64)
{
const char *regs = fxsave;
@@ -1195,8 +1195,11 @@ amd64_collect_fxsave (const struct regcache *regcache, int regnum,
i387_collect_fxsave (regcache, regnum, fxsave);
- if (regnum == -1 || regnum == I387_FISEG_REGNUM)
- regcache_raw_collect (regcache, I387_FISEG_REGNUM, regs + 12);
- if (regnum == -1 || regnum == I387_FOSEG_REGNUM)
- regcache_raw_collect (regcache, I387_FOSEG_REGNUM, regs + 20);
+ if (gdbarch_ptr_bit (get_regcache_arch (regcache)) == 64)
+ {
+ if (regnum == -1 || regnum == I387_FISEG_REGNUM)
+ regcache_raw_collect (regcache, I387_FISEG_REGNUM, regs + 12);
+ if (regnum == -1 || regnum == I387_FOSEG_REGNUM)
+ regcache_raw_collect (regcache, I387_FOSEG_REGNUM, regs + 20);
+ }
}