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.
This commit is contained in:
H.J. Lu
2013-12-19 14:24:34 -08:00
parent e85596e021
commit 1e87984a63
2 changed files with 8 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
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

View 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;