[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 29/29] target/riscv: honour show_opcodes when disassembling
From: |
Alex Bennée |
Subject: |
[PATCH 29/29] target/riscv: honour show_opcodes when disassembling |
Date: |
Tue, 5 Mar 2024 12:10:05 +0000 |
This makes the output suitable when used for plugins.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
disas/riscv.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/disas/riscv.c b/disas/riscv.c
index 8a546d5ea53..9dec8fa966f 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,
--
2.39.2
- [PATCH 14/29] plugins: scoreboard API, (continued)
- [PATCH 14/29] plugins: scoreboard API, Alex Bennée, 2024/03/05
- [PATCH 11/29] gdbstub: Introduce gdb_handle_detach_user(), Alex Bennée, 2024/03/05
- [PATCH 07/29] {linux,bsd}-user: Pass pid to gdbserver_fork(), Alex Bennée, 2024/03/05
- [PATCH 10/29] gdbstub: Introduce gdb_handle_set_thread_user(), Alex Bennée, 2024/03/05
- [PATCH 13/29] tests/tcg: Add two follow-fork-mode tests, Alex Bennée, 2024/03/05
- [PATCH 16/29] plugins: implement inline operation relative to cpu_index, Alex Bennée, 2024/03/05
- [PATCH 15/29] plugins: define qemu_plugin_u64, Alex Bennée, 2024/03/05
- [PATCH 08/29] gdbstub: Call gdbserver_fork() both in parent and in child, Alex Bennée, 2024/03/05
- [PATCH 23/29] contrib/plugins/howvec: migrate to new per_vcpu API, Alex Bennée, 2024/03/05
- [PATCH 17/29] plugins: add inline operation per vcpu, Alex Bennée, 2024/03/05
- [PATCH 29/29] target/riscv: honour show_opcodes when disassembling,
Alex Bennée <=
- [PATCH 26/29] disas: introduce show_opcodes, Alex Bennée, 2024/03/05
- [PATCH 18/29] tests/plugin: add test plugin for inline operations, Alex Bennée, 2024/03/05
- [PATCH 22/29] contrib/plugins/hotblocks: migrate to new per_vcpu API, Alex Bennée, 2024/03/05
- [PATCH 28/29] target/loongarch: honour show_opcodes when disassembling, Alex Bennée, 2024/03/05
- [PATCH 25/29] plugins: cleanup codepath for previous inline operation, Alex Bennée, 2024/03/05
- [PATCH 21/29] tests/plugin/bb: migrate to new per_vcpu API, Alex Bennée, 2024/03/05
- [PATCH 24/29] plugins: remove non per_vcpu inline operation from API, Alex Bennée, 2024/03/05