aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2024-03-05 12:10:04 +0000
committerAlex Bennée <alex.bennee@linaro.org>2024-03-06 12:35:51 +0000
commitf6e0eabdb4647275d98c63982c0065dd80be7caf (patch)
tree240b449337f4ff7bf0f45f9f9af84ea12193dfbf
parent7cff154b48d5ce64b6d65388c43a9a818672ec00 (diff)
downloadqemu-f6e0eabdb4647275d98c63982c0065dd80be7caf.zip
qemu-f6e0eabdb4647275d98c63982c0065dd80be7caf.tar.gz
qemu-f6e0eabdb4647275d98c63982c0065dd80be7caf.tar.bz2
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>
-rw-r--r--target/loongarch/disas.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/target/loongarch/disas.c b/target/loongarch/disas.c
index 2040f3e..63989a6 100644
--- a/target/loongarch/disas.c
+++ b/target/loongarch/disas.c
@@ -120,10 +120,15 @@ static const char *get_csr_name(unsigned num)
csr_names[num] : "Undefined CSR";
}
-#define output(C, INSN, FMT, ...) \
-{ \
- (C)->info->fprintf_func((C)->info->stream, "%08x %-9s\t" FMT, \
- (C)->insn, INSN, ##__VA_ARGS__); \
+#define output(C, INSN, FMT, ...) \
+ { \
+ if ((C)->info->show_opcodes) { \
+ (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"