bellard | b9adb4a | 2003-04-29 20:41:16 +0000 | [diff] [blame] | 1 | #ifndef _QEMU_DISAS_H |
| 2 | #define _QEMU_DISAS_H |
| 3 | |
aliguori | 376253e | 2009-03-05 23:01:23 +0000 | [diff] [blame] | 4 | #include "qemu-common.h" |
| 5 | |
Blue Swirl | ca20cf3 | 2009-09-20 14:58:02 +0000 | [diff] [blame] | 6 | #ifdef NEED_CPU_H |
bellard | b9adb4a | 2003-04-29 20:41:16 +0000 | [diff] [blame] | 7 | /* Disassemble this for me please... (debugging). */ |
bellard | c27004e | 2005-01-03 23:35:10 +0000 | [diff] [blame] | 8 | void disas(FILE *out, void *code, unsigned long size); |
bellard | 83b34f8 | 2005-01-23 20:26:30 +0000 | [diff] [blame] | 9 | void target_disas(FILE *out, target_ulong code, target_ulong size, int flags); |
aliguori | 376253e | 2009-03-05 23:01:23 +0000 | [diff] [blame] | 10 | |
aliguori | 376253e | 2009-03-05 23:01:23 +0000 | [diff] [blame] | 11 | void monitor_disas(Monitor *mon, CPUState *env, |
bellard | 3476562 | 2005-11-21 23:35:10 +0000 | [diff] [blame] | 12 | target_ulong pc, int nb_insn, int is_physical, int flags); |
bellard | b9adb4a | 2003-04-29 20:41:16 +0000 | [diff] [blame] | 13 | |
| 14 | /* Look up symbol for debugging purpose. Returns "" if unknown. */ |
bellard | c27004e | 2005-01-03 23:35:10 +0000 | [diff] [blame] | 15 | const char *lookup_symbol(target_ulong orig_addr); |
Blue Swirl | ca20cf3 | 2009-09-20 14:58:02 +0000 | [diff] [blame] | 16 | #endif |
bellard | b9adb4a | 2003-04-29 20:41:16 +0000 | [diff] [blame] | 17 | |
pbrook | 49918a7 | 2008-10-22 15:11:31 +0000 | [diff] [blame] | 18 | struct syminfo; |
| 19 | struct elf32_sym; |
| 20 | struct elf64_sym; |
| 21 | |
Paul Brook | 9f9f030 | 2010-03-01 03:55:48 +0000 | [diff] [blame] | 22 | #if defined(CONFIG_USER_ONLY) |
| 23 | typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_ulong orig_addr); |
| 24 | #else |
Anthony Liguori | c227f09 | 2009-10-01 16:12:16 -0500 | [diff] [blame] | 25 | typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_phys_addr_t orig_addr); |
Paul Brook | 9f9f030 | 2010-03-01 03:55:48 +0000 | [diff] [blame] | 26 | #endif |
pbrook | 49918a7 | 2008-10-22 15:11:31 +0000 | [diff] [blame] | 27 | |
| 28 | struct syminfo { |
| 29 | lookup_symbol_t lookup_symbol; |
bellard | e80cfcf | 2004-12-19 23:18:01 +0000 | [diff] [blame] | 30 | unsigned int disas_num_syms; |
pbrook | 49918a7 | 2008-10-22 15:11:31 +0000 | [diff] [blame] | 31 | union { |
| 32 | struct elf32_sym *elf32; |
| 33 | struct elf64_sym *elf64; |
| 34 | } disas_symtab; |
bellard | e80cfcf | 2004-12-19 23:18:01 +0000 | [diff] [blame] | 35 | const char *disas_strtab; |
| 36 | struct syminfo *next; |
pbrook | 49918a7 | 2008-10-22 15:11:31 +0000 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | /* Filled in by elfload.c. Simplistic, but will do for now. */ |
| 40 | extern struct syminfo *syminfos; |
bellard | e80cfcf | 2004-12-19 23:18:01 +0000 | [diff] [blame] | 41 | |
bellard | b9adb4a | 2003-04-29 20:41:16 +0000 | [diff] [blame] | 42 | #endif /* _QEMU_DISAS_H */ |