diff options
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/amd64-nat.c | 13 |
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e741021..18b8a53 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2004-02-28 Mark Kettenis <kettenis@gnu.org> + * amd64-nat.c: Include "gdb_string.h". + (amd64_collect_native_gregset): Zero-extend the 32-bit + general-purpose registers and %eip. + * amd64-tdep.h: (amd64_collect_fxsave): New prototype. * amd64-tdep.c (amd64_collect_fxsave): New function. (amd64_fill_fxsave): Simply call amd64_collect_fxsave. diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c index 81a87b6..1efe47a 100644 --- a/gdb/amd64-nat.c +++ b/gdb/amd64-nat.c @@ -24,6 +24,7 @@ #include "regcache.h" #include "gdb_assert.h" +#include "gdb_string.h" #include "i386-tdep.h" #include "amd64-tdep.h" @@ -128,7 +129,17 @@ amd64_collect_native_gregset (const struct regcache *regcache, int i; if (gdbarch_ptr_bit (gdbarch) == 32) - num_regs = amd64_native_gregset32_num_regs; + { + num_regs = amd64_native_gregset32_num_regs; + + /* Make sure %eax, %ebx, %ecx, %edx, %esi, %edi, %ebp, %esp and + %eip get zero-extended to 64 bits. */ + for (i = 0; i <= I386_EIP_REGNUM; i++) + { + if (regnum == -1 || regnum == i) + memset (regs + amd64_native_gregset_reg_offset (i), 0, 8); + } + } if (num_regs > NUM_REGS) num_regs = NUM_REGS; |