mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
disas: Use translator_st to get disassembly data
Read from already translated pages, or saved mmio data. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
c0d691ab84
commit
4c833c60e0
8 changed files with 41 additions and 23 deletions
|
@ -11,6 +11,19 @@
|
|||
#include "hw/core/cpu.h"
|
||||
#include "monitor/monitor.h"
|
||||
|
||||
/*
|
||||
* Get LENGTH bytes from info's buffer, at target address memaddr.
|
||||
* Transfer them to myaddr.
|
||||
*/
|
||||
static int
|
||||
virtual_read_memory(bfd_vma memaddr, bfd_byte *myaddr, int length,
|
||||
struct disassemble_info *info)
|
||||
{
|
||||
CPUDebug *s = container_of(info, CPUDebug, info);
|
||||
int r = cpu_memory_rw_debug(s->cpu, memaddr, myaddr, length, 0);
|
||||
return r ? EIO : 0;
|
||||
}
|
||||
|
||||
static int
|
||||
physical_read_memory(bfd_vma memaddr, bfd_byte *myaddr, int length,
|
||||
struct disassemble_info *info)
|
||||
|
@ -38,6 +51,8 @@ void monitor_disas(Monitor *mon, CPUState *cpu, uint64_t pc,
|
|||
|
||||
if (is_physical) {
|
||||
s.info.read_memory_func = physical_read_memory;
|
||||
} else {
|
||||
s.info.read_memory_func = virtual_read_memory;
|
||||
}
|
||||
s.info.buffer_vma = pc;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue