* i386-tdep.c (i386_match_insn_block): Use length of the proper
authorMark Kettenis <kettenis@gnu.org>
Sun, 12 Jun 2011 18:21:55 +0000 (18:21 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sun, 12 Jun 2011 18:21:55 +0000 (18:21 +0000)
instruction when walking back through the instruction stream.

gdb/ChangeLog
gdb/i386-tdep.c

index c72fda47fccad0353d96d7f0fc063de708a809ce..ab49a3fb58e3aee98ceab20b4d2be40643352743 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-12  Mark Kettenis  <kettenis@gnu.org>
+
+       * i386-tdep.c (i386_match_insn_block): Use length of the proper
+       instruction when walking back through the instruction stream.
+
 2011-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * symtab.c (output_partial_symbol_filename): Exchange the filename and
index b2b74121a678598073191843126b7ed01f61da66..8355508136e83afc836d35eab34523d633588fa8 100644 (file)
@@ -1191,14 +1191,14 @@ i386_match_insn_block (CORE_ADDR pc, struct i386_insn *insn_patterns)
   if (insn == NULL)
     return 0;
 
-  current_pc = pc - insn->len;
+  current_pc = pc;
   ix = insn - insn_patterns;
   for (i = ix - 1; i >= 0; i--)
     {
+      current_pc -= insn_patterns[i].len;
+
       if (!i386_match_pattern (current_pc, insn_patterns[i]))
        return 0;
-
-      current_pc -= insn_patterns[i].len;
     }
 
   current_pc = pc + insn->len;