| 1 | #ifndef QEMU_DISAS_H |
| 2 | #define QEMU_DISAS_H |
| 3 | |
| 4 | #include "monitor/hmp.h" |
| 5 | |
| 6 | /* Disassemble this for me please... (debugging). */ |
| 7 | #ifdef CONFIG_TCG |
| 8 | void disas(FILE *out, const void *code, size_t size); |
| 9 | void target_disas(FILE *out, CPUState *cpu, const DisasContextBase *db); |
| 10 | #endif |
| 11 | |
| 12 | void monitor_disas(MonitorHMP *hmp, CPUState *cpu, uint64_t pc, |
| 13 | int nb_insn, bool is_physical); |
| 14 | |
| 15 | #ifdef CONFIG_PLUGIN |
| 16 | char *plugin_disas(CPUState *cpu, const DisasContextBase *db, |
| 17 | uint64_t addr, size_t size); |
| 18 | #endif |
| 19 | |
| 20 | /* Look up symbol for debugging purpose. Returns "" if unknown. */ |
| 21 | const char *lookup_symbol(uint64_t orig_addr); |
| 22 | |
| 23 | struct syminfo; |
| 24 | struct elf32_sym; |
| 25 | struct elf64_sym; |
| 26 | |
| 27 | typedef const char *(*lookup_symbol_t)(struct syminfo *s, uint64_t orig_addr); |
| 28 | |
| 29 | struct syminfo { |
| 30 | lookup_symbol_t lookup_symbol; |
| 31 | unsigned int disas_num_syms; |
| 32 | union { |
| 33 | struct elf32_sym *elf32; |
| 34 | struct elf64_sym *elf64; |
| 35 | } disas_symtab; |
| 36 | const char *disas_strtab; |
| 37 | struct syminfo *next; |
| 38 | }; |
| 39 | |
| 40 | /* Filled in by elfload.c. Simplistic, but will do for now. */ |
| 41 | extern struct syminfo *syminfos; |
| 42 | |
| 43 | #endif /* QEMU_DISAS_H */ |