This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Fix i386-tdep.c:i386_match_insn()
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gdb-patches at sourceware dot org
- Cc: jmolenda at apple dot com
- Date: Mon, 18 Jul 2005 21:18:45 +0200 (CEST)
- Subject: [commit] Fix i386-tdep.c:i386_match_insn()
As a first step towards integrating Jason's patch to improve the i386
prologue scanner, I committed the part of Jason's patch to make
i386_match_insn() actually do what I intended it to do.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
Jason Molenda <jmolenda@apple.com>
* i386-tdep.c (i386_match_insn): Match complete instruction
pattern.
2005-07-18 Mark Kettenis <kettenis@gnu.org>
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.216
diff -u -p -r1.216 i386-tdep.c
--- i386-tdep.c 18 Jul 2005 12:40:13 -0000 1.216
+++ i386-tdep.c 18 Jul 2005 19:15:42 -0000
@@ -499,7 +499,8 @@ i386_match_insn (CORE_ADDR pc, struct i3
{
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 i3
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;
}
}