aboutsummaryrefslogtreecommitdiff
path: root/opcodes/m32r-asm.c
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>1997-04-10 21:58:28 +0000
committerDavid Edelsohn <dje.gcc@gmail.com>1997-04-10 21:58:28 +0000
commit5b3b8cb07149b04b6e612ddae2b01958f839025f (patch)
tree53fa0d21eeabd4f82f9421594c640fa64f0f07f4 /opcodes/m32r-asm.c
parentfe2dd6424b58b9f0e79a891f7fe3023d6c820730 (diff)
downloadgdb-5b3b8cb07149b04b6e612ddae2b01958f839025f.zip
gdb-5b3b8cb07149b04b6e612ddae2b01958f839025f.tar.gz
gdb-5b3b8cb07149b04b6e612ddae2b01958f839025f.tar.bz2
* cgen-asm.c (cgen_asm_parse_operand_fn): New global.
(cgen_parse_{{,un}signed_integer,address}): Update call to cgen_asm_parse_operand_fn. * m32r-asm.c (parse_insn_normal): Delete call to cgen_asm_init_parse. (m32r_cgen_assemble_insn): New operand `errmsg'. Delete call to as_bad, return error message to caller. (m32r_cgen_asm_hash_keywords): #if 0 out.
Diffstat (limited to 'opcodes/m32r-asm.c')
-rw-r--r--opcodes/m32r-asm.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/opcodes/m32r-asm.c b/opcodes/m32r-asm.c
index 068b30f..824366c 100644
--- a/opcodes/m32r-asm.c
+++ b/opcodes/m32r-asm.c
@@ -551,7 +551,6 @@ parse_insn_normal (insn, strp, fields)
#endif
CGEN_INIT_PARSE ();
- cgen_asm_init_parse ();
#ifdef CGEN_MNEMONIC_OPERANDS
past_opcode_p = 0;
#endif
@@ -678,10 +677,11 @@ insert_insn_normal (insn, fields, buffer)
printed). */
const struct cgen_insn *
-m32r_cgen_assemble_insn (str, fields, buf)
+m32r_cgen_assemble_insn (str, fields, buf, errmsg)
const char *str;
struct cgen_fields *fields;
cgen_insn_t *buf;
+ char **errmsg;
{
const char *start;
CGEN_INSN_LIST *ilist;
@@ -740,13 +740,22 @@ m32r_cgen_assemble_insn (str, fields, buf)
/* Try the next entry. */
}
- /* FIXME: Define this as a callback, or pass back string? */
- as_bad ("bad instruction `%s'", start);
- return NULL;
+ /* FIXME: We can return a better error message than this.
+ Need to track why it failed and pick the right one. */
+ {
+ static char errbuf[100];
+ sprintf (errbuf, "bad instruction `%.50s%s'",
+ start, strlen (start) > 50 ? "..." : "");
+ *errmsg = errbuf;
+ return NULL;
+ }
}
+#if 0 /* This calls back to GAS which we can't do without care. */
+
/* Record each member of OPVALS in the assembler's symbol table.
- FIXME: Not currently used. */
+ This lets GAS parse registers for us.
+ ??? Interesting idea but not currently used. */
void
m32r_cgen_asm_hash_keywords (opvals)
@@ -764,3 +773,5 @@ m32r_cgen_asm_hash_keywords (opvals)
cgen_asm_record_register (ke->name, ke->value);
}
}
+
+#endif /* 0 */