Properly decode MODRM byte for 64-bit
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 19 Dec 2013 22:24:34 +0000 (14:24 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 19 Dec 2013 22:24:34 +0000 (14:24 -0800)
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.

gdb/ChangeLog
gdb/i386-tdep.c

index c12e907..76cedd7 100644 (file)
@@ -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.
 
index ff37851..8992088 100644 (file)
@@ -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;