[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 24/43] disas: Push const down through host disasassembly
From: |
Richard Henderson |
Subject: |
[PATCH v4 24/43] disas: Push const down through host disasassembly |
Date: |
Mon, 14 Dec 2020 08:02:55 -0600 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/disas/dis-asm.h | 4 ++--
disas.c | 4 +---
disas/capstone.c | 2 +-
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h
index 2164762b46..d1133a4e04 100644
--- a/include/disas/dis-asm.h
+++ b/include/disas/dis-asm.h
@@ -358,7 +358,7 @@ typedef struct disassemble_info {
(bfd_vma addr, struct disassemble_info * info);
/* These are for buffer_read_memory. */
- bfd_byte *buffer;
+ const bfd_byte *buffer;
bfd_vma buffer_vma;
int buffer_length;
@@ -462,7 +462,7 @@ int print_insn_rx(bfd_vma, disassemble_info *);
#ifdef CONFIG_CAPSTONE
bool cap_disas_target(disassemble_info *info, uint64_t pc, size_t size);
-bool cap_disas_host(disassemble_info *info, void *code, size_t size);
+bool cap_disas_host(disassemble_info *info, const void *code, size_t size);
bool cap_disas_monitor(disassemble_info *info, uint64_t pc, int count);
bool cap_disas_plugin(disassemble_info *info, uint64_t pc, size_t size);
#else
diff --git a/disas.c b/disas.c
index de1de7be94..a61f95b580 100644
--- a/disas.c
+++ b/disas.c
@@ -299,10 +299,8 @@ char *plugin_disas(CPUState *cpu, uint64_t addr, size_t
size)
}
/* Disassemble this for me please... (debugging). */
-void disas(FILE *out, const void *ccode, unsigned long size)
+void disas(FILE *out, const void *code, unsigned long size)
{
- /* TODO: Push constness through the disas backends. */
- void *code = (void *)ccode;
uintptr_t pc;
int count;
CPUDebug s;
diff --git a/disas/capstone.c b/disas/capstone.c
index 7462c0e305..20bc8f9669 100644
--- a/disas/capstone.c
+++ b/disas/capstone.c
@@ -229,7 +229,7 @@ bool cap_disas_target(disassemble_info *info, uint64_t pc,
size_t size)
}
/* Disassemble SIZE bytes at CODE for the host. */
-bool cap_disas_host(disassemble_info *info, void *code, size_t size)
+bool cap_disas_host(disassemble_info *info, const void *code, size_t size)
{
csh handle;
const uint8_t *cbuf;
--
2.25.1
- [PATCH v4 18/43] accel/tcg: Support split-wx for linux with memfd, (continued)
- [PATCH v4 18/43] accel/tcg: Support split-wx for linux with memfd, Richard Henderson, 2020/12/14
- [PATCH v4 15/43] tcg: Make tb arg to synchronize_from_tb const, Richard Henderson, 2020/12/14
- [PATCH v4 20/43] tcg: Return the TB pointer from the rx region from exit_tb, Richard Henderson, 2020/12/14
- [PATCH v4 16/43] tcg: Use Error with alloc_code_gen_buffer, Richard Henderson, 2020/12/14
- [PATCH v4 13/43] tcg: Adjust tb_target_set_jmp_target for split-wx, Richard Henderson, 2020/12/14
- [PATCH v4 19/43] accel/tcg: Support split-wx for darwin/iOS with vm_remap, Richard Henderson, 2020/12/14
- [PATCH v4 17/43] tcg: Add --accel tcg,split-wx property, Richard Henderson, 2020/12/14
- [PATCH v4 21/43] tcg/i386: Support split-wx code generation, Richard Henderson, 2020/12/14
- [PATCH v4 22/43] tcg/aarch64: Use B not BL for tcg_out_goto_long, Richard Henderson, 2020/12/14
- [PATCH v4 25/43] tcg/tci: Push const down through bytecode reading, Richard Henderson, 2020/12/14
- [PATCH v4 24/43] disas: Push const down through host disasassembly,
Richard Henderson <=
- [PATCH v4 28/43] tcg/ppc: Use tcg_out_mem_long to reset TCG_REG_TB, Richard Henderson, 2020/12/14
- [PATCH v4 27/43] tcg/ppc: Use tcg_tbrel_diff, Richard Henderson, 2020/12/14
- [PATCH v4 29/43] tcg/ppc: Support split-wx code generation, Richard Henderson, 2020/12/14
- [PATCH v4 30/43] tcg/sparc: Use tcg_tbrel_diff, Richard Henderson, 2020/12/14
- [PATCH v4 26/43] tcg: Introduce tcg_tbrel_diff, Richard Henderson, 2020/12/14
- [PATCH v4 23/43] tcg/aarch64: Support split-wx code generation, Richard Henderson, 2020/12/14
- [PATCH v4 31/43] tcg/sparc: Support split-wx code generation, Richard Henderson, 2020/12/14
- [PATCH v4 32/43] tcg/s390: Use tcg_tbrel_diff, Richard Henderson, 2020/12/14
- [PATCH v4 33/43] tcg/s390: Support split-wx code generation, Richard Henderson, 2020/12/14