From ecfbeec8d0a7687a6464caa088b2283b30a25d7e Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Tue, 1 Nov 2022 14:09:17 +0000 Subject: libopcodes/mips: add support for disassembler styling This commit adds disassembler styling support for MIPS. After this commit objdump and GDB will style disassembler output. This is a pretty straight forward change, we switch to use the disassemble_info::fprintf_styled_func callback, and pass an appropriate style through as needed. No additional tricks were needed (compared to say i386, or ARM). Tested by running all of the objdump commands used by the gas testsuite and manually inspecting the styled output, everything looks reasonable, though I'm not a MIPS expert, so it is possible that I've missed some corner cases. Worst case though is that something will be styled incorrectly, the actual content should be unchanged. All the gas, ld, and binutils tests still pass for me. --- opcodes/disassemble.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'opcodes/disassemble.c') diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c index 0a8f2da629f..b8e0bd14b51 100644 --- a/opcodes/disassemble.c +++ b/opcodes/disassemble.c @@ -663,6 +663,11 @@ disassemble_init_for_target (struct disassemble_info * info) info->disassembler_needs_relocs = true; break; #endif +#ifdef ARCH_mips + case bfd_arch_mips: + info->created_styled_output = true; + break; +#endif #ifdef ARCH_m32c case bfd_arch_m32c: /* This processor in fact is little endian. The value set here -- cgit v1.2.1