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