summaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2013-12-19 14:22:30 -0800
committerH.J. Lu <hjl.tools@gmail.com>2013-12-19 14:22:30 -0800
commite85596e021d0c4246a4ea21885c52e91583c463e (patch)
tree80b45087330044f895c71f6950008e61c66d8636 /gdb/i386-tdep.c
parent8ee5199a42ae43b3a9b349640b8a0e2125ede34f (diff)
Zero-extend address from 32-bit to 64-bit for ADDR32 prefix
When there is ADDR32 prefix in 64-bit mode, we should zero-extend address from 32-bit to 64-bit. PR gdb/16304 * i386-tdep.c (i386_record_lea_modrm_addr): Zero-extend 32-bit address to 64-bit in 64-bit mode.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index f876675c4d..ff37851781 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -4282,6 +4282,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
{