xref: /openbmc/qemu/include/disas/disas.h (revision c6bd8c70)
1 #ifndef _QEMU_DISAS_H
2 #define _QEMU_DISAS_H
3 
4 #include "qemu-common.h"
5 
6 #ifdef NEED_CPU_H
7 /* Disassemble this for me please... (debugging). */
8 void disas(FILE *out, void *code, unsigned long size);
9 void target_disas(FILE *out, CPUState *cpu, target_ulong code,
10                   target_ulong size, int flags);
11 
12 void monitor_disas(Monitor *mon, CPUState *cpu,
13                    target_ulong pc, int nb_insn, int is_physical, int flags);
14 
15 /* Look up symbol for debugging purpose.  Returns "" if unknown. */
16 const char *lookup_symbol(target_ulong orig_addr);
17 #endif
18 
19 struct syminfo;
20 struct elf32_sym;
21 struct elf64_sym;
22 
23 #if defined(CONFIG_USER_ONLY)
24 typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_ulong orig_addr);
25 #else
26 typedef const char *(*lookup_symbol_t)(struct syminfo *s, hwaddr orig_addr);
27 #endif
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 */
44