aboutsummaryrefslogtreecommitdiff
path: root/gdb/amd64-nat.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-02-28 21:55:48 +0000
committerMark Kettenis <kettenis@gnu.org>2004-02-28 21:55:48 +0000
commit041bd74ba620da092df8278c9be728121d907a42 (patch)
tree1abf3972597ba356da5531e5d23dbb1e1c854379 /gdb/amd64-nat.c
parent0558264b6b0de204ad4c91fa9b228fa57f42a788 (diff)
downloadgdb-041bd74ba620da092df8278c9be728121d907a42.zip
gdb-041bd74ba620da092df8278c9be728121d907a42.tar.gz
gdb-041bd74ba620da092df8278c9be728121d907a42.tar.bz2
* amd64-nat.c: Include "gdb_string.h".
(amd64_collect_native_gregset): Zero-extend the 32-bit general-purpose registers and %eip.
Diffstat (limited to 'gdb/amd64-nat.c')
-rw-r--r--gdb/amd64-nat.c13
1 files changed, 12 insertions, 1 deletions
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;