This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Fix AMD64 32x64 floating point bug
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 9 Apr 2004 23:23:15 +0200 (CEST)
- Subject: [PATCH] Fix AMD64 32x64 floating point bug
I messed up the handling of floating point registers in the case of
32-bit on 64-bit cross debugging. Fixed for Linux and *BSD by the
attached patch.
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* amd64-linux-nat.c (fetch_inferior_registers): Correctly check
whether a register is supplied by PTRACE_GETFPREGS.
(store_inferior_registers): Likewise.
* amd64bsd-nat.c (fetch_inferior_registers): Correctly check
whether a register is supplied by PT_GETFPREGS.
(store_inferior_registers): Likewise.
Index: amd64-linux-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64-linux-nat.c,v
retrieving revision 1.7
diff -u -p -r1.7 amd64-linux-nat.c
--- amd64-linux-nat.c 14 Mar 2004 22:39:26 -0000 1.7
+++ amd64-linux-nat.c 9 Apr 2004 20:26:47 -0000
@@ -169,7 +169,7 @@ fetch_inferior_registers (int regnum)
return;
}
- if (regnum == -1 || regnum >= AMD64_ST0_REGNUM)
+ if (regnum == -1 || !amd64_native_gregset_supplies_p (regnum))
{
elf_fpregset_t fpregs;
@@ -210,7 +210,7 @@ store_inferior_registers (int regnum)
return;
}
- if (regnum == -1 || regnum >= AMD64_ST0_REGNUM)
+ if (regnum == -1 || !amd64_native_gregset_supplies_p (regnum))
{
elf_fpregset_t fpregs;
Index: amd64bsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/amd64bsd-nat.c,v
retrieving revision 1.4
diff -u -p -r1.4 amd64bsd-nat.c
--- amd64bsd-nat.c 4 Mar 2004 10:35:57 -0000 1.4
+++ amd64bsd-nat.c 9 Apr 2004 20:26:47 -0000
@@ -54,7 +54,7 @@ fetch_inferior_registers (int regnum)
return;
}
- if (regnum == -1 || regnum >= AMD64_ST0_REGNUM)
+ if (regnum == -1 || !amd64_native_gregset_supplies_p (regnum))
{
struct fpreg fpregs;
@@ -90,7 +90,7 @@ store_inferior_registers (int regnum)
return;
}
- if (regnum == -1 || regnum >= AMD64_ST0_REGNUM)
+ if (regnum == -1 || !amd64_native_gregset_supplies_p (regnum))
{
struct fpreg fpregs;