aboutsummaryrefslogtreecommitdiff
path: root/opcodes/ia64-opc.c
diff options
context:
space:
mode:
authorTimothy Wall <twall@alum.mit.edu>2000-04-23 02:39:13 +0000
committerTimothy Wall <twall@alum.mit.edu>2000-04-23 02:39:13 +0000
commitaa170a07eb955e54eccf5df5129a4e2c92d7c5a1 (patch)
tree8beaa123cef99aa93d55442c7acc06a8907a8e05 /opcodes/ia64-opc.c
parentdc8d251e9c86a76a916824bfd79d289c4964c8bd (diff)
downloadgdb-aa170a07eb955e54eccf5df5129a4e2c92d7c5a1.zip
gdb-aa170a07eb955e54eccf5df5129a4e2c92d7c5a1.tar.gz
gdb-aa170a07eb955e54eccf5df5129a4e2c92d7c5a1.tar.bz2
Misc assembly/disassembly fixes.
Diffstat (limited to 'opcodes/ia64-opc.c')
-rw-r--r--opcodes/ia64-opc.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/opcodes/ia64-opc.c b/opcodes/ia64-opc.c
index a25dd66..c054b3d 100644
--- a/opcodes/ia64-opc.c
+++ b/opcodes/ia64-opc.c
@@ -346,7 +346,8 @@ opcode_verify (opcode, place, type)
/* Find an instruction entry in the ia64_dis_names array that matches
opcode OPCODE and is of type TYPE. Returns either a positive index
into the array, or a negative value if an entry for OPCODE could
- not be found. */
+ not be found. Checks all matches and returns the one with the highest
+ priority. */
static int
locate_opcode_ent (opcode, type)
@@ -357,6 +358,8 @@ locate_opcode_ent (opcode, type)
int bitpos[41];
int op_ptr[41];
int currstatenum = 0;
+ short found_disent = -1;
+ short found_priority = -1;
currtest[currstatenum] = 0;
op_ptr[currstatenum] = 0;
@@ -463,6 +466,7 @@ locate_opcode_ent (opcode, type)
if ((next_op >= 0) && (next_op & 32768))
{
short disent = next_op & 32767;
+ short priority = -1;
if (next_op > 65535)
{
@@ -475,7 +479,10 @@ locate_opcode_ent (opcode, type)
{
int place = ia64_dis_names[disent].insn_index;
- if (opcode_verify (opcode, place, type))
+ priority = ia64_dis_names[disent].priority;
+
+ if (opcode_verify (opcode, place, type)
+ && priority > found_priority)
{
break;
}
@@ -491,13 +498,12 @@ locate_opcode_ent (opcode, type)
if (disent >= 0)
{
- return disent;
- }
- else
- {
- /* Failed to match; try the next test in this state. */
- next_op = -2;
+ found_disent = disent;
+ found_priority = priority;
}
+ /* Try the next test in this state, regardless of whether a match
+ was found. */
+ next_op = -2;
}
/* next_op == -1 is "back up to the previous state".
@@ -509,7 +515,7 @@ locate_opcode_ent (opcode, type)
currstatenum--;
if (currstatenum < 0)
{
- return -1;
+ return found_disent;
}
}
else if (next_op >= 0)