diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2013-12-19 14:22:30 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2013-12-19 14:22:30 -0800 |
commit | e85596e021d0c4246a4ea21885c52e91583c463e (patch) | |
tree | 80b45087330044f895c71f6950008e61c66d8636 /gdb/i386-tdep.c | |
parent | 8ee5199a42ae43b3a9b349640b8a0e2125ede34f (diff) | |
download | gdb-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/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 7 |
1 files changed, 7 insertions, 0 deletions
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 { |