blob: 06abab21ebc6032763747b1d06c62aa24fde7cd2 [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
11/* The usual mess... FIXME: Remove this condition once dyngen-exec.h is gone */
12#ifndef __DYNGEN_EXEC_H__
13void monitor_disas(Monitor *mon, CPUState *env,
bellard34765622005-11-21 23:35:10 +000014 target_ulong pc, int nb_insn, int is_physical, int flags);
aliguori376253e2009-03-05 23:01:23 +000015#endif
bellardb9adb4a2003-04-29 20:41:16 +000016
17/* Look up symbol for debugging purpose. Returns "" if unknown. */
bellardc27004e2005-01-03 23:35:10 +000018const char *lookup_symbol(target_ulong orig_addr);
Blue Swirlca20cf32009-09-20 14:58:02 +000019#endif
bellardb9adb4a2003-04-29 20:41:16 +000020
pbrook49918a72008-10-22 15:11:31 +000021struct syminfo;
22struct elf32_sym;
23struct elf64_sym;
24
Anthony Liguoric227f092009-10-01 16:12:16 -050025typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_phys_addr_t orig_addr);
pbrook49918a72008-10-22 15:11:31 +000026
27struct syminfo {
28 lookup_symbol_t lookup_symbol;
bellarde80cfcf2004-12-19 23:18:01 +000029 unsigned int disas_num_syms;
pbrook49918a72008-10-22 15:11:31 +000030 union {
31 struct elf32_sym *elf32;
32 struct elf64_sym *elf64;
33 } disas_symtab;
bellarde80cfcf2004-12-19 23:18:01 +000034 const char *disas_strtab;
35 struct syminfo *next;
pbrook49918a72008-10-22 15:11:31 +000036};
37
38/* Filled in by elfload.c. Simplistic, but will do for now. */
39extern struct syminfo *syminfos;
bellarde80cfcf2004-12-19 23:18:01 +000040
bellardb9adb4a2003-04-29 20:41:16 +000041#endif /* _QEMU_DISAS_H */