This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
cgen opcodes/asm patch
- To: binutils at sources dot redhat dot com, cgen at sources dot redhat dot com
- Subject: cgen opcodes/asm patch
- From: "Frank Ch. Eigler" <fche at redhat dot com>
- Date: Thu, 28 Dec 2000 14:51:17 -0500
Hi -
I'm about to commit a small patch to opcodes/cgen-asm.in, intended to
improve the error message for an instruction that lacks required operands.
2000-12-28 Frank Ch. Eigler <fche@redhat.com>
* cgen-asm.in (parse_insn_normal): Print better error message for
instructions with missing operands.
Index: cgen-asm.in
===================================================================
RCS file: /cvs/src/src/opcodes/cgen-asm.in,v
retrieving revision 1.2
diff -c -p -r1.2 cgen-asm.in
*** cgen-asm.in 2000/12/13 18:55:02 1.2
--- cgen-asm.in 2000/12/28 19:49:49
*************** parse_insn_normal (cd, insn, strp, field
*** 127,139 ****
++ syn;
++ str;
}
! else
{
/* Syntax char didn't match. Can't be this insn. */
static char msg [80];
/* xgettext:c-format */
sprintf (msg, _("syntax error (expected char `%c', found `%c')"),
*syn, *str);
return msg;
}
continue;
--- 127,148 ----
++ syn;
++ str;
}
! else if (*str)
{
/* Syntax char didn't match. Can't be this insn. */
static char msg [80];
/* xgettext:c-format */
sprintf (msg, _("syntax error (expected char `%c', found `%c')"),
*syn, *str);
+ return msg;
+ }
+ else
+ {
+ /* Ran out of input. */
+ static char msg [80];
+ /* xgettext:c-format */
+ sprintf (msg, _("syntax error (expected char `%c', found end of instruction)"),
+ *syn);
return msg;
}
continue;