diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-04-04 22:38:04 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-04-04 22:41:24 +0100 |
commit | 7b01c1cc1d111ba0afa51e60fa9842d3b971e2d1 (patch) | |
tree | ba53406de8080613704aa3247a77dd9a360e1521 /sim/erc32/sis.c | |
parent | 0578e87f93b09e4cc41d3982eb1672bcfc81042d (diff) | |
download | gdb-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/erc32/sis.c')
-rw-r--r-- | sim/erc32/sis.c | 18 |
1 files changed, 17 insertions, 1 deletions
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 |