From: H.J. Lu Date: Thu, 19 Dec 2013 22:22:30 +0000 (-0800) Subject: Zero-extend address from 32-bit to 64-bit for ADDR32 prefix X-Git-Tag: gdb-7.7-release~155 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e85596e021d0c4246a4ea21885c52e91583c463e;p=external%2Fbinutils.git 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. --- 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 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 + + 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 {