diff options
author | Hui Zhu <teawater@gmail.com> | 2009-08-29 05:32:16 +0000 |
---|---|---|
committer | Hui Zhu <teawater@gmail.com> | 2009-08-29 05:32:16 +0000 |
commit | 77d7dc9283af8e77f27314c9e2e79fbdea9ce7ff (patch) | |
tree | 811b9fec2bf2e34c7a6f91f3518cdc45f8fc3fe3 | |
parent | 791f39718a26c3fbedbd1f6a90956ecdfe03340a (diff) | |
download | gdb-77d7dc9283af8e77f27314c9e2e79fbdea9ce7ff.zip gdb-77d7dc9283af8e77f27314c9e2e79fbdea9ce7ff.tar.gz gdb-77d7dc9283af8e77f27314c9e2e79fbdea9ce7ff.tar.bz2 |
2009-08-29 Hui Zhu <teawater@gmail.com>
* i386-tdep.c (i386_process_record): Fix the error of string
ops instructions's handler.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/i386-tdep.c | 69 |
2 files changed, 38 insertions, 36 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e035de2..32fcf5d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2009-08-29 Hui Zhu <teawater@gmail.com> + + * i386-tdep.c (i386_process_record): Fix the error of string + ops instructions's handler. + 2009-08-28 Doug Evans <dje@google.com> * top.c (execute_command): Remove redundant comment. diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index def86cf..0381bc9 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -4443,50 +4443,47 @@ reswitch: /* insS */ case 0x6c: case 0x6d: - if ((opcode & 1) == 0) - ir.ot = OT_BYTE; - else - ir.ot = ir.dflag + OT_WORD; regcache_raw_read_unsigned (ir.regcache, - ir.regmap[X86_RECORD_REDI_REGNUM], + ir.regmap[X86_RECORD_RECX_REGNUM], &tmpulongest); - if (!ir.aflag) - { - tmpulongest &= 0xffff; - /* addr += ((uint32_t) read_register (I386_ES_REGNUM)) << 4; */ - if (record_debug) - printf_unfiltered (_("Process record ignores the memory change " - "of instruction at address 0x%s because " - "it can't get the value of the segment " - "register.\n"), - paddress (gdbarch, ir.addr)); - } - if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) + if (tmpulongest) { - ULONGEST count, eflags; + ULONGEST es, ds; + + if ((opcode & 1) == 0) + ir.ot = OT_BYTE; + else + ir.ot = ir.dflag + OT_WORD; regcache_raw_read_unsigned (ir.regcache, ir.regmap[X86_RECORD_REDI_REGNUM], - &count); - if (!ir.aflag) - count &= 0xffff; + &tmpulongest); + regcache_raw_read_unsigned (ir.regcache, - ir.regmap[X86_RECORD_EFLAGS_REGNUM], - &eflags); - if ((eflags >> 10) & 0x1) - tmpulongest -= (count - 1) * (1 << ir.ot); - if (record_arch_list_add_mem (tmpulongest, count * (1 << ir.ot))) - return -1; - I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_RECX_REGNUM); - } - else - { + ir.regmap[X86_RECORD_ES_REGNUM], + &es); + regcache_raw_read_unsigned (ir.regcache, + ir.regmap[X86_RECORD_DS_REGNUM], + &ds); + if (ir.aflag && (es != ds)) + { + /* addr += ((uint32_t) read_register (I386_ES_REGNUM)) << 4; */ + if (record_debug) + printf_unfiltered (_("Process record ignores the memory " + "change of instruction at address 0x%s " + "because it can't get the value of the " + "ES segment register.\n"), + paddress (gdbarch, ir.addr)); + } + + if (prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) + I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_RECX_REGNUM); if (record_arch_list_add_mem (tmpulongest, 1 << ir.ot)) return -1; - } - if (opcode == 0xa4 || opcode == 0xa5) - I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_RESI_REGNUM); - I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_REDI_REGNUM); - I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_EFLAGS_REGNUM); + if (opcode == 0xa4 || opcode == 0xa5) + I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_RESI_REGNUM); + I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_REDI_REGNUM); + I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_EFLAGS_REGNUM); + } break; /* cmpsS */ |