target/loongarch: honour show_opcodes when disassembling

This makes the output suitable when used for plugins.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240305121005.3528075-29-alex.bennee@linaro.org>
This commit is contained in:
Alex Bennée 2024-03-05 12:10:04 +00:00
parent 7cff154b48
commit f6e0eabdb4
1 changed files with 9 additions and 4 deletions

View File

@ -120,10 +120,15 @@ static const char *get_csr_name(unsigned num)
csr_names[num] : "Undefined CSR"; csr_names[num] : "Undefined CSR";
} }
#define output(C, INSN, FMT, ...) \ #define output(C, INSN, FMT, ...) \
{ \ { \
(C)->info->fprintf_func((C)->info->stream, "%08x %-9s\t" FMT, \ if ((C)->info->show_opcodes) { \
(C)->insn, INSN, ##__VA_ARGS__); \ (C)->info->fprintf_func((C)->info->stream, "%08x %-9s\t" FMT,\
(C)->insn, INSN, ##__VA_ARGS__); \
} else { \
(C)->info->fprintf_func((C)->info->stream, "%-9s\t" FMT, \
INSN, ##__VA_ARGS__); \
} \
} }
#include "decode-insns.c.inc" #include "decode-insns.c.inc"