aboutsummaryrefslogtreecommitdiff
path: root/gdb/rs6000-pinsn.c
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1992-04-17 01:35:42 +0000
committerPer Bothner <per@bothner.com>1992-04-17 01:35:42 +0000
commitd453b386ac60cb219f5949da95cb99d1e22ad6b9 (patch)
treeaaf7cbe5c2c04731813654a84ae84ed90ba53c63 /gdb/rs6000-pinsn.c
parentc0532cf36ba83d86825b8647b892f4d3d090ba7c (diff)
downloadgdb-d453b386ac60cb219f5949da95cb99d1e22ad6b9.zip
gdb-d453b386ac60cb219f5949da95cb99d1e22ad6b9.tar.gz
gdb-d453b386ac60cb219f5949da95cb99d1e22ad6b9.tar.bz2
* rs6000-pinsn.c: New version from IBM (Metin).
* m2-exp.y: Re-write string initializers ("<>" => {'<', '>'}) to avoid warnings from some compilers.
Diffstat (limited to 'gdb/rs6000-pinsn.c')
-rw-r--r--gdb/rs6000-pinsn.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/rs6000-pinsn.c b/gdb/rs6000-pinsn.c
index 6880370..03261e5 100644
--- a/gdb/rs6000-pinsn.c
+++ b/gdb/rs6000-pinsn.c
@@ -29,7 +29,7 @@ print_insn (memaddr, stream)
CORE_ADDR memaddr;
FILE *stream;
{
- int pop, eop; /* primary and extended opcodes */
+ int pop, eop, probable_eop; /* primary and extended opcodes */
int min, max;
int best = -1; /* found best opcode index */
int oldbest = -1;
@@ -37,7 +37,6 @@ print_insn (memaddr, stream)
read_memory (memaddr, &the_insn, sizeof (the_insn));
pop = (unsigned)(the_insn >> 26);
- eop = ((the_insn) >> 1) & 0x3ff;
min = 0, max = NOPCODES-1;
while (min < max) {
@@ -55,7 +54,7 @@ print_insn (memaddr, stream)
min = best;
else {
- /* opcode matched, check extended opcode. */
+ /* Opcode matched, check extended opcode. */
if (rs6k_ops [best].e_opcode == -1) {
/* there is no valid extended opcode, what we've got is
@@ -63,12 +62,18 @@ print_insn (memaddr, stream)
goto insn_found;
}
- else if (eop < rs6k_ops [best].e_opcode) {
+ /* Largest possible value of extended opcode. */
+ probable_eop = ((the_insn) >> 1) & 0x3ff;
+
+ eop = probable_eop & eopMask [rs6k_ops [best].format];
+
+ if (eop < rs6k_ops [best].e_opcode) {
while (pop == rs6k_ops [best].p_opcode) {
if (eop == rs6k_ops [best].e_opcode) /* found it! */
goto insn_found;
--best;
+ eop = probable_eop & eopMask [rs6k_ops [best].format];
}
goto not_found;
}
@@ -79,6 +84,7 @@ print_insn (memaddr, stream)
if (eop == rs6k_ops [best].e_opcode) /* found it! */
goto insn_found;
++best;
+ eop = probable_eop & eopMask [rs6k_ops [best].format];
}
goto not_found;
}