aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2013-12-19 14:24:34 -0800
committerH.J. Lu <hjl.tools@gmail.com>2013-12-19 14:24:34 -0800
commit1e87984a63faf4378f6f71c407f7e969441b944e (patch)
tree0c2803edc84c3f21d8b6585f1cf8cf64de3bdd6b
parente85596e021d0c4246a4ea21885c52e91583c463e (diff)
downloadgdb-1e87984a63faf4378f6f71c407f7e969441b944e.zip
gdb-1e87984a63faf4378f6f71c407f7e969441b944e.tar.gz
gdb-1e87984a63faf4378f6f71c407f7e969441b944e.tar.bz2
Properly decode MODRM byte for 64-bit
64-bit mode doesn't use 16-bit address. We should always check SIB byte for address in 64-bit mode. PR gdb/16304 * i386-tdep.c (i386_record_lea_modrm_addr): Don't use 16-bit address in 64-bit mode.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/i386-tdep.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c12e907..76cedd7 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): Don't use 16-bit
+ address in 64-bit mode.
+
+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.
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index ff37851..8992088 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -4209,9 +4209,9 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
ULONGEST offset64;
*addr = 0;
- if (irp->aflag)
+ if (irp->aflag || irp->regmap[X86_RECORD_R8_REGNUM])
{
- /* 32 bits */
+ /* 32/64 bits */
int havesib = 0;
uint8_t scale = 0;
uint8_t byte;