aboutsummaryrefslogtreecommitdiff
path: root/gdb
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
parent8ee5199a42ae43b3a9b349640b8a0e2125ede34f (diff)
downloadgdb-e85596e021d0c4246a4ea21885c52e91583c463e.zip
gdb-e85596e021d0c4246a4ea21885c52e91583c463e.tar.gz
gdb-e85596e021d0c4246a4ea21885c52e91583c463e.tar.bz2
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')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/i386-tdep.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c8cd42a..c12e907 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,6 +1,12 @@
2013-12-19 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.
+
+2013-12-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR gdb/16304
* amd64-linux-tdep.c (amd64_canonicalize_syscall): Handle x32
system calls.
(amd64_x32_linux_record_tdep): New.
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index f876675..ff37851 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
{