From: Alex Bennée Date: Tue, 5 Mar 2024 12:10:05 +0000 (+0000) Subject: target/riscv: honour show_opcodes when disassembling X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=db7e8b1f75662cf957f6bfad938ed112488518ed;p=qemu.git target/riscv: honour show_opcodes when disassembling This makes the output suitable when used for plugins. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20240305121005.3528075-30-alex.bennee@linaro.org> --- diff --git a/disas/riscv.c b/disas/riscv.c index 8a546d5ea5..e236c8b5b7 100644 --- a/disas/riscv.c +++ b/disas/riscv.c @@ -5192,19 +5192,21 @@ print_insn_riscv(bfd_vma memaddr, struct disassemble_info *info, rv_isa isa) } } - switch (len) { - case 2: - (*info->fprintf_func)(info->stream, INST_FMT_2, inst); - break; - case 4: - (*info->fprintf_func)(info->stream, INST_FMT_4, inst); - break; - case 6: - (*info->fprintf_func)(info->stream, INST_FMT_6, inst); - break; - default: - (*info->fprintf_func)(info->stream, INST_FMT_8, inst); - break; + if (info->show_opcodes) { + switch (len) { + case 2: + (*info->fprintf_func)(info->stream, INST_FMT_2, inst); + break; + case 4: + (*info->fprintf_func)(info->stream, INST_FMT_4, inst); + break; + case 6: + (*info->fprintf_func)(info->stream, INST_FMT_6, inst); + break; + default: + (*info->fprintf_func)(info->stream, INST_FMT_8, inst); + break; + } } disasm_inst(buf, sizeof(buf), isa, memaddr, inst,