From 613e81350872d53825863c0f87edecaf99f09e10 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 18 Jul 2005 19:18:41 +0000 Subject: [PATCH] Jason Molenda * i386-tdep.c (i386_match_insn): Match complete instruction pattern. --- gdb/ChangeLog | 6 ++++++ gdb/i386-tdep.c | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b200e701170..eb827f7c053 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2005-07-18 Mark Kettenis + Jason Molenda + + * i386-tdep.c (i386_match_insn): Match complete instruction + pattern. + 2005-07-18 Mark Kettenis * i386-tdep.c (i386_reg_struct_return_p): Handle structures with a diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 7c047870b3d..3fd82a69ceb 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -499,7 +499,8 @@ i386_match_insn (CORE_ADDR pc, struct i386_insn *skip_insns) { if ((op & insn->mask[0]) == insn->insn[0]) { - unsigned char buf[I386_MAX_INSN_LEN - 1]; + gdb_byte buf[I386_MAX_INSN_LEN - 1]; + int insn_matched = 1; size_t i; gdb_assert (insn->len > 1); @@ -509,10 +510,11 @@ i386_match_insn (CORE_ADDR pc, struct i386_insn *skip_insns) for (i = 1; i < insn->len; i++) { if ((buf[i - 1] & insn->mask[i]) != insn->insn[i]) - break; - - return insn; + insn_matched = 0; } + + if (insn_matched) + return insn; } } -- 2.30.2