[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 26/29] disas: introduce show_opcodes
From: |
Alex Bennée |
Subject: |
[PATCH 26/29] disas: introduce show_opcodes |
Date: |
Tue, 5 Mar 2024 12:10:02 +0000 |
For plugins we don't expect the raw opcodes in the disassembly. We
already deal with this by hand crafting our capstone call but for
other diassemblers we need a flag. Introduce show_opcodes which
defaults to off.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
include/disas/dis-asm.h | 8 ++++++++
disas/disas.c | 1 +
2 files changed, 9 insertions(+)
diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h
index 2324f6b1a46..b26867b6417 100644
--- a/include/disas/dis-asm.h
+++ b/include/disas/dis-asm.h
@@ -396,6 +396,14 @@ typedef struct disassemble_info {
/* Command line options specific to the target disassembler. */
char * disassembler_options;
+ /*
+ * When true instruct the disassembler it may preface the
+ * disassembly with the opcodes values if it wants to. This is
+ * mainly for the benefit of the plugin interface which doesn't want
+ * that.
+ */
+ bool show_opcodes;
+
/* Field intended to be used by targets in any way they deem suitable. */
void *target_info;
diff --git a/disas/disas.c b/disas/disas.c
index 0d2d06c2ecc..17170d291ec 100644
--- a/disas/disas.c
+++ b/disas/disas.c
@@ -299,6 +299,7 @@ void disas(FILE *out, const void *code, size_t size)
s.info.buffer = code;
s.info.buffer_vma = (uintptr_t)code;
s.info.buffer_length = size;
+ s.info.show_opcodes = true;
if (s.info.cap_arch >= 0 && cap_disas_host(&s.info, code, size)) {
return;
--
2.39.2
- [PATCH 07/29] {linux,bsd}-user: Pass pid to gdbserver_fork(), (continued)
- [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, 2024/03/05
- [PATCH 26/29] disas: introduce show_opcodes,
Alex Bennée <=
- [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
- [PATCH 19/29] tests/plugin/mem: migrate to new per_vcpu API, Alex Bennée, 2024/03/05
- [PATCH 27/29] disas/hppa: honour show_opcodes, Alex Bennée, 2024/03/05