aboutsummaryrefslogtreecommitdiff
path: root/sim/erc32
diff options
context:
space:
mode:
Diffstat (limited to 'sim/erc32')
-rw-r--r--sim/erc32/interf.c3
-rw-r--r--sim/erc32/sis.c18
-rw-r--r--sim/erc32/sis.h3
3 files changed, 22 insertions, 2 deletions
diff --git a/sim/erc32/interf.c b/sim/erc32/interf.c
index d04d07c..78dec6f 100644
--- a/sim/erc32/interf.c
+++ b/sim/erc32/interf.c
@@ -244,7 +244,8 @@ sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *callback,
#ifdef F_GETFL
termsave = fcntl(0, F_GETFL, 0);
#endif
- INIT_DISASSEMBLE_INFO(dinfo, stdout,(fprintf_ftype)fprintf);
+ INIT_DISASSEMBLE_INFO(dinfo, stdout,(fprintf_ftype)fprintf,
+ fprintf_styled);
#ifdef HOST_LITTLE_ENDIAN
dinfo.endian = BFD_ENDIAN_LITTLE;
#else
diff --git a/sim/erc32/sis.c b/sim/erc32/sis.c
index 66a27d0..12eb21f 100644
--- a/sim/erc32/sis.c
+++ b/sim/erc32/sis.c
@@ -139,6 +139,21 @@ run_sim(struct pstate *sregs, uint64_t icount, int dis)
}
int
+fprintf_styled (void *stream, enum disassembler_style style,
+ const char *fmt, ...)
+{
+ int ret;
+ FILE *out = (FILE *) stream;
+ va_list args;
+
+ va_start (args, fmt);
+ ret = vfprintf (out, fmt, args);
+ va_end (args);
+
+ return ret;
+}
+
+int
main(int argc, char **argv)
{
@@ -212,7 +227,8 @@ main(int argc, char **argv)
#endif
sregs.freq = freq;
- INIT_DISASSEMBLE_INFO(dinfo, stdout, (fprintf_ftype) fprintf);
+ INIT_DISASSEMBLE_INFO(dinfo, stdout, (fprintf_ftype) fprintf,
+ (fprintf_styled_ftype) fprintf_styled);
#ifdef HOST_LITTLE_ENDIAN
dinfo.endian = BFD_ENDIAN_LITTLE;
#else
diff --git a/sim/erc32/sis.h b/sim/erc32/sis.h
index 33f16c7..3a27667 100644
--- a/sim/erc32/sis.h
+++ b/sim/erc32/sis.h
@@ -18,6 +18,7 @@
#include "sim/sim.h"
#include <sim-config.h>
#include <stdint.h>
+#include "dis-asm.h"
#if HOST_BYTE_ORDER == BIG_ENDIAN
#define HOST_BIG_ENDIAN
@@ -203,6 +204,8 @@ extern void init_regs (struct pstate *sregs);
/* interf.c */
extern int run_sim (struct pstate *sregs,
uint64_t icount, int dis);
+extern int fprintf_styled (void *stream, enum disassembler_style style,
+ const char *fmt, ...) ATTRIBUTE_PRINTF (3, 4);
/* float.c */
extern int get_accex (void);