* opc2c.c: Include "libiberty.h" and <errno.h>.
(orig_filename): Constify. (dump_lines): Fix line number directive. (main): Set orig_filename to basename of input file. Use xstrerror. * Makefile.am (rx-dis.lo): Remove explicit dependencies. ($(srcdir)/rx-decode.c): Use @MAINT@. Use $(EXEEXT_FOR_BUILD) instead of $(EXEEXT). (opc2c$(EXEEXT_FOR_BUILD)): Renamed from opc2c$(EXEEXT) and use $(LINK_FOR_BUILD). Link with libiberty. (MOSTLYCLEANFILES): Add opc2c$(EXEEXT_FOR_BUILD). (MAINTAINERCLEANFILES): Add $(srcdir)/rx-decode.c. * Makefile.in: Regenerated. * rx-decode.c: Regenerated.
This commit is contained in:
parent
8d417781d6
commit
49293ef70b
5 changed files with 656 additions and 630 deletions
|
@ -1,3 +1,21 @@
|
|||
2009-10-03 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
* opc2c.c: Include "libiberty.h" and <errno.h>.
|
||||
(orig_filename): Constify.
|
||||
(dump_lines): Fix line number directive.
|
||||
(main): Set orig_filename to basename of input file. Use
|
||||
xstrerror.
|
||||
|
||||
* Makefile.am (rx-dis.lo): Remove explicit dependencies.
|
||||
($(srcdir)/rx-decode.c): Use @MAINT@. Use $(EXEEXT_FOR_BUILD)
|
||||
instead of $(EXEEXT).
|
||||
(opc2c$(EXEEXT_FOR_BUILD)): Renamed from opc2c$(EXEEXT) and use
|
||||
$(LINK_FOR_BUILD). Link with libiberty.
|
||||
(MOSTLYCLEANFILES): Add opc2c$(EXEEXT_FOR_BUILD).
|
||||
(MAINTAINERCLEANFILES): Add $(srcdir)/rx-decode.c.
|
||||
* Makefile.in: Regenerated.
|
||||
* rx-decode.c: Regenerated.
|
||||
|
||||
2009-10-03 Paul Reed <paulreed@paddedcell.com>
|
||||
|
||||
* arm-dis.c (print_insn): Check symtab_size not *symtab.
|
||||
|
|
|
@ -437,14 +437,6 @@ stamp-iq2000: $(CGENDEPS) $(srcdir)/../cpu/iq2000.cpu \
|
|||
archfile=$(srcdir)/../cpu/iq2000.cpu \
|
||||
opcfile=$(srcdir)/../cpu/iq2000.opc extrafiles=
|
||||
|
||||
$(srcdir)/rx-decode.c : $(srcdir)/rx-decode.opc opc2c$(EXEEXT)
|
||||
./opc2c$(EXEEXT) $(srcdir)/rx-decode.opc > $(srcdir)/rx-decode.c
|
||||
|
||||
rx-dis.lo : rx-dis.c sysdep.h config.h $(BFD_H) $(INCDIR)/opcode/rx.h
|
||||
|
||||
opc2c$(EXEEXT) : $(srcdir)/opc2c.c
|
||||
gcc $(srcdir)/opc2c.c -o opc2c$(EXEEXT)
|
||||
|
||||
$(srcdir)/xstormy16-desc.h $(srcdir)/xstormy16-desc.c $(srcdir)/xstormy16-opc.h $(srcdir)/xstormy16-opc.c $(srcdir)/xstormy16-ibld.c $(srcdir)/xstormy16-asm.c $(srcdir)/xstormy16-dis.c: $(XSTORMY16_DEPS)
|
||||
@true
|
||||
stamp-xstormy16: $(CGENDEPS) $(CPUDIR)/xstormy16.cpu $(CPUDIR)/xstormy16.opc
|
||||
|
@ -458,10 +450,12 @@ stamp-xc16x: $(CGENDEPS) $(CPUDIR)/xc16x.cpu $(CPUDIR)/xc16x.opc
|
|||
archfile=$(CPUDIR)/xc16x.cpu opcfile=$(CPUDIR)/xc16x.opc extrafiles=
|
||||
|
||||
MOSTLYCLEANFILES = i386-gen$(EXEEXT_FOR_BUILD) ia64-gen$(EXEEXT_FOR_BUILD) \
|
||||
s390-mkopc$(EXEEXT_FOR_BUILD) z8kgen$(EXEEXT_FOR_BUILD)
|
||||
s390-mkopc$(EXEEXT_FOR_BUILD) z8kgen$(EXEEXT_FOR_BUILD) \
|
||||
opc2c$(EXEEXT_FOR_BUILD)
|
||||
|
||||
MAINTAINERCLEANFILES = $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h \
|
||||
$(srcdir)/ia64-asmtab.c s390-opc.tab $(srcdir)/z8k-opc.h
|
||||
$(srcdir)/ia64-asmtab.c s390-opc.tab $(srcdir)/z8k-opc.h \
|
||||
$(srcdir)/rx-decode.c
|
||||
|
||||
i386-gen$(EXEEXT_FOR_BUILD): i386-gen.o $(BUILD_LIB_DEPS)
|
||||
$(LINK_FOR_BUILD) i386-gen.o $(BUILD_LIBS)
|
||||
|
@ -499,6 +493,15 @@ $(srcdir)/ia64-asmtab.c: @MAINT@ $(ia64_asmtab_deps)
|
|||
|
||||
ia64-opc.lo: $(srcdir)/ia64-asmtab.c
|
||||
|
||||
$(srcdir)/rx-decode.c: @MAINT@ $(srcdir)/rx-decode.opc opc2c$(EXEEXT_FOR_BUILD)
|
||||
./opc2c$(EXEEXT_FOR_BUILD) $(srcdir)/rx-decode.opc > $(srcdir)/rx-decode.c
|
||||
|
||||
opc2c$(EXEEXT_FOR_BUILD): opc2c.o $(BUILD_LIBS_DEPS)
|
||||
$(LINK_FOR_BUILD) opc2c.o $(BUILD_LIBS)
|
||||
|
||||
opc2c.o: opc2c.c $(INCDIR)/libiberty.h
|
||||
$(COMPILE_FOR_BUILD) -c $(srcdir)/opc2c.c
|
||||
|
||||
s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.c
|
||||
$(COMPILE_FOR_BUILD) -o s390-mkopc $(srcdir)/s390-mkopc.c
|
||||
|
||||
|
|
|
@ -586,10 +586,12 @@ CGEN_CPUS = fr30 frv ip2k m32c m32r mep mt openrisc xc16x xstormy16
|
|||
@CGEN_MAINT_FALSE@XSTORMY16_DEPS =
|
||||
@CGEN_MAINT_TRUE@XSTORMY16_DEPS = stamp-xstormy16
|
||||
MOSTLYCLEANFILES = i386-gen$(EXEEXT_FOR_BUILD) ia64-gen$(EXEEXT_FOR_BUILD) \
|
||||
s390-mkopc$(EXEEXT_FOR_BUILD) z8kgen$(EXEEXT_FOR_BUILD)
|
||||
s390-mkopc$(EXEEXT_FOR_BUILD) z8kgen$(EXEEXT_FOR_BUILD) \
|
||||
opc2c$(EXEEXT_FOR_BUILD)
|
||||
|
||||
MAINTAINERCLEANFILES = $(srcdir)/i386-tbl.h $(srcdir)/i386-init.h \
|
||||
$(srcdir)/ia64-asmtab.c s390-opc.tab $(srcdir)/z8k-opc.h
|
||||
$(srcdir)/ia64-asmtab.c s390-opc.tab $(srcdir)/z8k-opc.h \
|
||||
$(srcdir)/rx-decode.c
|
||||
|
||||
|
||||
# Use a helper variable for the dependencies to avoid 'make' issues
|
||||
|
@ -1284,14 +1286,6 @@ stamp-iq2000: $(CGENDEPS) $(srcdir)/../cpu/iq2000.cpu \
|
|||
archfile=$(srcdir)/../cpu/iq2000.cpu \
|
||||
opcfile=$(srcdir)/../cpu/iq2000.opc extrafiles=
|
||||
|
||||
$(srcdir)/rx-decode.c : $(srcdir)/rx-decode.opc opc2c$(EXEEXT)
|
||||
./opc2c$(EXEEXT) $(srcdir)/rx-decode.opc > $(srcdir)/rx-decode.c
|
||||
|
||||
rx-dis.lo : rx-dis.c sysdep.h config.h $(BFD_H) $(INCDIR)/opcode/rx.h
|
||||
|
||||
opc2c$(EXEEXT) : $(srcdir)/opc2c.c
|
||||
gcc $(srcdir)/opc2c.c -o opc2c$(EXEEXT)
|
||||
|
||||
$(srcdir)/xstormy16-desc.h $(srcdir)/xstormy16-desc.c $(srcdir)/xstormy16-opc.h $(srcdir)/xstormy16-opc.c $(srcdir)/xstormy16-ibld.c $(srcdir)/xstormy16-asm.c $(srcdir)/xstormy16-dis.c: $(XSTORMY16_DEPS)
|
||||
@true
|
||||
stamp-xstormy16: $(CGENDEPS) $(CPUDIR)/xstormy16.cpu $(CPUDIR)/xstormy16.opc
|
||||
|
@ -1335,6 +1329,15 @@ $(srcdir)/ia64-asmtab.c: @MAINT@ $(ia64_asmtab_deps)
|
|||
|
||||
ia64-opc.lo: $(srcdir)/ia64-asmtab.c
|
||||
|
||||
$(srcdir)/rx-decode.c: @MAINT@ $(srcdir)/rx-decode.opc opc2c$(EXEEXT_FOR_BUILD)
|
||||
./opc2c$(EXEEXT_FOR_BUILD) $(srcdir)/rx-decode.opc > $(srcdir)/rx-decode.c
|
||||
|
||||
opc2c$(EXEEXT_FOR_BUILD): opc2c.o $(BUILD_LIBS_DEPS)
|
||||
$(LINK_FOR_BUILD) opc2c.o $(BUILD_LIBS)
|
||||
|
||||
opc2c.o: opc2c.c $(INCDIR)/libiberty.h
|
||||
$(COMPILE_FOR_BUILD) -c $(srcdir)/opc2c.c
|
||||
|
||||
s390-mkopc$(EXEEXT_FOR_BUILD): s390-mkopc.c
|
||||
$(COMPILE_FOR_BUILD) -o s390-mkopc $(srcdir)/s390-mkopc.c
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include "libiberty.h"
|
||||
|
||||
static char * line_buf = NULL;
|
||||
static int line_buf_size = 0;
|
||||
|
@ -288,7 +290,7 @@ dump_lines (opcode * op, int level, Indirect * ind)
|
|||
}
|
||||
*np = 0;
|
||||
varnames[vn++] = strdup (name);
|
||||
printf ("#line %d \"%s\"\n", op->lineno, orig_filename);
|
||||
printf ("#line %d \"%s\"\n", op->lineno + 1, orig_filename);
|
||||
if (mask & ~0xff)
|
||||
{
|
||||
fprintf (stderr, "Error: variable %s spans bytes: %s\n",
|
||||
|
@ -586,19 +588,19 @@ main (int argc, char ** argv)
|
|||
exit (1);
|
||||
}
|
||||
|
||||
orig_filename = argv[1];
|
||||
orig_filename = lbasename (argv[1]);
|
||||
in = fopen (argv[1], "r");
|
||||
if (!in)
|
||||
{
|
||||
fprintf (stderr, "Unable to open file %s for reading\n", argv[1]);
|
||||
perror ("The error was");
|
||||
fprintf (stderr, "Unable to open file %s for reading: %s\n", argv[1],
|
||||
xstrerror (errno));
|
||||
exit (1);
|
||||
}
|
||||
|
||||
n_opcodes = 0;
|
||||
opcodes = (opcode **) malloc (sizeof (opcode *));
|
||||
op = &prefix_text;
|
||||
op->lineno = 1;
|
||||
op->lineno = 0;
|
||||
while ((line = safe_fgets (in)) != 0)
|
||||
{
|
||||
lineno++;
|
||||
|
|
1210
opcodes/rx-decode.c
1210
opcodes/rx-decode.c
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue