mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 20:33:54 -06:00
plugins: Copy memory in qemu_plugin_insn_data
Instead of returning a host pointer, copy the data into storage provided by the caller. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
bf4bb074b7
commit
4abc892362
4 changed files with 17 additions and 14 deletions
|
@ -258,8 +258,9 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
|
|||
NULL);
|
||||
}
|
||||
} else {
|
||||
uint32_t insn_opcode;
|
||||
insn_opcode = *((uint32_t *)qemu_plugin_insn_data(insn));
|
||||
uint32_t insn_opcode = 0;
|
||||
qemu_plugin_insn_data(insn, &insn_opcode, sizeof(insn_opcode));
|
||||
|
||||
char *output = g_strdup_printf("0x%"PRIx64", 0x%"PRIx32", \"%s\"",
|
||||
insn_vaddr, insn_opcode, insn_disas);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue