This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
AM33 disassembler: fix for long-standing bug
- To: binutils at sourceware dot cygnus dot com, gdb-patches at sourceware dot cygnus dot com
- Subject: AM33 disassembler: fix for long-standing bug
- From: Alexandre Oliva <aoliva at cygnus dot com>
- Date: 14 Apr 2000 02:44:35 -0300
- Organization: Cygnus Solutions, a Red Hat Company
The few instructions marked as AM30 in opcodes/m10300-opc.c wouldn't
be recognized by the AM33 disassembler. Previously, they wouldn't
have been recognized by the AM33 assembler either, but when I fixed
it, it releaved this one. Here's a patch. Ok to install? Binutils
release branch? GDB release branch?
Index: opcodes/ChangeLog
by Alexandre Oliva <aoliva@cygnus.com>
* m10300-dis.c (HAVE_AM30, HAVE_AM33): Define.
(disassemble): Use them.
Index: opcodes/m10300-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/m10300-dis.c,v
retrieving revision 1.2
diff -u -r1.2 m10300-dis.c
--- opcodes/m10300-dis.c 1999/12/01 10:36:22 1.2
+++ opcodes/m10300-dis.c 2000/04/12 20:45:49
@@ -26,6 +26,9 @@
static void disassemble PARAMS ((bfd_vma, struct disassemble_info *,
unsigned long insn, unsigned int));
+#define HAVE_AM33 (info->mach == AM33)
+#define HAVE_AM30 (info->mach == 0 || info->mach == AM30 || HAVE_AM33)
+
int
print_insn_mn10300 (memaddr, info)
bfd_vma memaddr;
@@ -250,7 +253,8 @@
if ((op->mask & insn) == op->opcode
&& size == (unsigned int) mysize
&& (op->machine == 0
- || op->machine == info->mach))
+ || (op->machine == AM33 && HAVE_AM33)
+ || (op->machine == AM30 && HAVE_AM30)))
{
const unsigned char *opindex_ptr;
unsigned int nocomma;
--
Alexandre Oliva Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me