* amd64-nat.c: Include "gdb_string.h".

(amd64_collect_native_gregset): Zero-extend the 32-bit
general-purpose registers and %eip.
This commit is contained in:
Mark Kettenis 2004-02-28 21:55:48 +00:00
parent 0558264b6b
commit 041bd74ba6
2 changed files with 16 additions and 1 deletions

View File

@ -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.

View File

@ -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;