2016-06-29 13:47:03 +02:00
|
|
|
#ifndef QEMU_DISAS_H
|
|
|
|
#define QEMU_DISAS_H
|
2003-04-29 22:41:16 +02:00
|
|
|
|
2019-08-12 07:23:31 +02:00
|
|
|
#include "exec/hwaddr.h"
|
2009-03-06 00:01:23 +01:00
|
|
|
|
2009-09-20 16:58:02 +02:00
|
|
|
#ifdef NEED_CPU_H
|
2016-03-15 16:58:45 +01:00
|
|
|
#include "cpu.h"
|
|
|
|
|
2003-04-29 22:41:16 +02:00
|
|
|
/* Disassemble this for me please... (debugging). */
|
2020-09-10 21:15:04 +02:00
|
|
|
void disas(FILE *out, void *code, unsigned long size);
|
2015-05-24 23:20:41 +02:00
|
|
|
void target_disas(FILE *out, CPUState *cpu, target_ulong code,
|
2017-09-14 17:38:35 +02:00
|
|
|
target_ulong size);
|
2009-03-06 00:01:23 +01:00
|
|
|
|
2015-05-24 23:20:41 +02:00
|
|
|
void monitor_disas(Monitor *mon, CPUState *cpu,
|
2017-09-14 17:38:35 +02:00
|
|
|
target_ulong pc, int nb_insn, int is_physical);
|
2003-04-29 22:41:16 +02:00
|
|
|
|
2019-05-22 11:27:14 +02:00
|
|
|
char *plugin_disas(CPUState *cpu, uint64_t addr, size_t size);
|
|
|
|
|
2003-04-29 22:41:16 +02:00
|
|
|
/* Look up symbol for debugging purpose. Returns "" if unknown. */
|
2005-01-04 00:35:10 +01:00
|
|
|
const char *lookup_symbol(target_ulong orig_addr);
|
2009-09-20 16:58:02 +02:00
|
|
|
#endif
|
2003-04-29 22:41:16 +02:00
|
|
|
|
2008-10-22 17:11:31 +02:00
|
|
|
struct syminfo;
|
|
|
|
struct elf32_sym;
|
|
|
|
struct elf64_sym;
|
|
|
|
|
2010-03-01 04:55:48 +01:00
|
|
|
#if defined(CONFIG_USER_ONLY)
|
|
|
|
typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_ulong orig_addr);
|
|
|
|
#else
|
2012-10-23 12:30:10 +02:00
|
|
|
typedef const char *(*lookup_symbol_t)(struct syminfo *s, hwaddr orig_addr);
|
2010-03-01 04:55:48 +01:00
|
|
|
#endif
|
2008-10-22 17:11:31 +02:00
|
|
|
|
|
|
|
struct syminfo {
|
|
|
|
lookup_symbol_t lookup_symbol;
|
2004-12-20 00:18:01 +01:00
|
|
|
unsigned int disas_num_syms;
|
2008-10-22 17:11:31 +02:00
|
|
|
union {
|
|
|
|
struct elf32_sym *elf32;
|
|
|
|
struct elf64_sym *elf64;
|
|
|
|
} disas_symtab;
|
2004-12-20 00:18:01 +01:00
|
|
|
const char *disas_strtab;
|
|
|
|
struct syminfo *next;
|
2008-10-22 17:11:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Filled in by elfload.c. Simplistic, but will do for now. */
|
|
|
|
extern struct syminfo *syminfos;
|
2004-12-20 00:18:01 +01:00
|
|
|
|
2016-06-29 13:47:03 +02:00
|
|
|
#endif /* QEMU_DISAS_H */
|