forked from Imagelibrary/binutils-gdb
sim: fixes for libopcodes styled disassembler
In commit:
commit 60a3da00bd
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.
This commit is contained in:
@@ -76,6 +76,19 @@ op_printf (char *buf, const char *fmt, ...)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ATTRIBUTE_PRINTF (3, 4)
|
||||
op_styled_printf (char *buf, enum disassembler_style style,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
int ret;
|
||||
va_list ap;
|
||||
|
||||
va_start (ap, fmt);
|
||||
ret = vsprintf (opbuf + strlen (opbuf), fmt, ap);
|
||||
va_end (ap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
sim_dis_read (bfd_vma memaddr ATTRIBUTE_UNUSED,
|
||||
bfd_byte * ptr,
|
||||
@@ -321,7 +334,7 @@ sim_create_inferior (SIM_DESC sd ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
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 (abfd);
|
||||
info.mach = bfd_get_mach (abfd);
|
||||
|
||||
Reference in New Issue
Block a user