blob: f9287f73e107a6fd85f223cd78ddee2753657da7 [file] [log] [blame]
bellardb9adb4a2003-04-29 20:41:16 +00001#ifndef _QEMU_DISAS_H
2#define _QEMU_DISAS_H
3
aliguori376253e2009-03-05 23:01:23 +00004#include "qemu-common.h"
5
Blue Swirlca20cf32009-09-20 14:58:02 +00006#ifdef NEED_CPU_H
bellardb9adb4a2003-04-29 20:41:16 +00007/* Disassemble this for me please... (debugging). */
bellardc27004e2005-01-03 23:35:10 +00008void disas(FILE *out, void *code, unsigned long size);
bellard83b34f82005-01-23 20:26:30 +00009void target_disas(FILE *out, target_ulong code, target_ulong size, int flags);
aliguori376253e2009-03-05 23:01:23 +000010
aliguori376253e2009-03-05 23:01:23 +000011void monitor_disas(Monitor *mon, CPUState *env,
bellard34765622005-11-21 23:35:10 +000012 target_ulong pc, int nb_insn, int is_physical, int flags);
bellardb9adb4a2003-04-29 20:41:16 +000013
14/* Look up symbol for debugging purpose. Returns "" if unknown. */
bellardc27004e2005-01-03 23:35:10 +000015const char *lookup_symbol(target_ulong orig_addr);
Blue Swirlca20cf32009-09-20 14:58:02 +000016#endif
bellardb9adb4a2003-04-29 20:41:16 +000017
pbrook49918a72008-10-22 15:11:31 +000018struct syminfo;
19struct elf32_sym;
20struct elf64_sym;
21
Paul Brook9f9f0302010-03-01 03:55:48 +000022#if defined(CONFIG_USER_ONLY)
23typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_ulong orig_addr);
24#else
Anthony Liguoric227f092009-10-01 16:12:16 -050025typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_phys_addr_t orig_addr);
Paul Brook9f9f0302010-03-01 03:55:48 +000026#endif
pbrook49918a72008-10-22 15:11:31 +000027
28struct syminfo {
29 lookup_symbol_t lookup_symbol;
bellarde80cfcf2004-12-19 23:18:01 +000030 unsigned int disas_num_syms;
pbrook49918a72008-10-22 15:11:31 +000031 union {
32 struct elf32_sym *elf32;
33 struct elf64_sym *elf64;
34 } disas_symtab;
bellarde80cfcf2004-12-19 23:18:01 +000035 const char *disas_strtab;
36 struct syminfo *next;
pbrook49918a72008-10-22 15:11:31 +000037};
38
39/* Filled in by elfload.c. Simplistic, but will do for now. */
40extern struct syminfo *syminfos;
bellarde80cfcf2004-12-19 23:18:01 +000041
bellardb9adb4a2003-04-29 20:41:16 +000042#endif /* _QEMU_DISAS_H */