aboutsummaryrefslogtreecommitdiff
path: root/sim/m32c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-04-04 22:38:04 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-04-04 22:41:24 +0100
commit7b01c1cc1d111ba0afa51e60fa9842d3b971e2d1 (patch)
treeba53406de8080613704aa3247a77dd9a360e1521 /sim/m32c
parent0578e87f93b09e4cc41d3982eb1672bcfc81042d (diff)
downloadgdb-7b01c1cc1d111ba0afa51e60fa9842d3b971e2d1.zip
gdb-7b01c1cc1d111ba0afa51e60fa9842d3b971e2d1.tar.gz
gdb-7b01c1cc1d111ba0afa51e60fa9842d3b971e2d1.tar.bz2
sim: fixes for libopcodes styled disassembler
In commit: commit 60a3da00bd5407f07d64dff82a4dae98230dfaac Date: Sat Jan 22 11:38:18 2022 +0000 objdump/opcodes: add syntax highlighting to disassembler output I broke several sim/ targets by forgetting to update their uses of the libopcodes disassembler to take account of the new styled printing. These should all be fixed by this commit. I've not tried to add actual styled output to the simulator traces, instead, the styled print routines just ignore the style and print the output unstyled.
Diffstat (limited to 'sim/m32c')
-rw-r--r--sim/m32c/trace.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sim/m32c/trace.c b/sim/m32c/trace.c
index 571df1a..f5171c2 100644
--- a/sim/m32c/trace.c
+++ b/sim/m32c/trace.c
@@ -101,6 +101,18 @@ op_printf (char *buf, char *fmt, ...)
return ret;
}
+static int
+op_styled_printf (char *buf, enum disassembler_style style, char *fmt, ...)
+{
+ int ret;
+ va_list ap;
+
+ va_start (ap, fmt);
+ ret = vsprintf (opbuf + strlen (opbuf), fmt, ap);
+ va_end (ap);
+ return ret;
+}
+
static bfd *current_bfd;
void
@@ -210,7 +222,7 @@ sim_disasm_one (void)
{
initted = 1;
memset (&info, 0, sizeof (info));
- INIT_DISASSEMBLE_INFO (info, stdout, op_printf);
+ INIT_DISASSEMBLE_INFO (info, stdout, op_printf, op_styled_printf);
info.read_memory_func = sim_dis_read;
info.arch = bfd_get_arch (current_bfd);
info.mach = bfd_get_mach (current_bfd);