This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/3] PR gdb/16304: Zero-extend address from 32-bit to 64-bit
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GDB <gdb-patches at sourceware dot org>
- Date: Sun, 8 Dec 2013 11:44:50 -0800
- Subject: [PATCH 3/3] PR gdb/16304: Zero-extend address from 32-bit to 64-bit
- Authentication-results: sourceware.org; auth=none
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
When there is ADDR32 prefix in 64-bit mode, we should zero-extend
address from 32-bit to 64-bit. Tested on Linux/x86-64. OK to install?
Thanks.
H.J.
----
2013-12-08 H.J. Lu <hongjiu.lu@intel.com>
PR gdb/16304
* i386-tdep.c (i386_record_lea_modrm_addr): Zero-extend 32-bit
address to 64-bit in 64-bit mode.
---
gdb/i386-tdep.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index be99aa3..17605ef 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -4265,6 +4265,13 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
else
*addr = (uint32_t) (*addr + (offset64 << scale));
}
+
+ if (!irp->aflag)
+ {
+ /* Since we are in 64-bit mode with ADDR32 prefix, zero-extend
+ address from 32-bit to 64-bit. */
+ *addr = (uint32_t) *addr;
+ }
}
else
{
--
1.8.3.1