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