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