blob: 6a9332d6ccbd2a33700dc62a56137d595a46aa2e [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
Paul Brook9f9f0302010-03-01 03:55:48 +000025#if defined(CONFIG_USER_ONLY)
26typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_ulong orig_addr);
27#else
Anthony Liguoric227f092009-10-01 16:12:16 -050028typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_phys_addr_t orig_addr);
Paul Brook9f9f0302010-03-01 03:55:48 +000029#endif
pbrook49918a72008-10-22 15:11:31 +000030
31struct syminfo {
32 lookup_symbol_t lookup_symbol;
bellarde80cfcf2004-12-19 23:18:01 +000033 unsigned int disas_num_syms;
pbrook49918a72008-10-22 15:11:31 +000034 union {
35 struct elf32_sym *elf32;
36 struct elf64_sym *elf64;
37 } disas_symtab;
bellarde80cfcf2004-12-19 23:18:01 +000038 const char *disas_strtab;
39 struct syminfo *next;
pbrook49918a72008-10-22 15:11:31 +000040};
41
42/* Filled in by elfload.c. Simplistic, but will do for now. */
43extern struct syminfo *syminfos;
bellarde80cfcf2004-12-19 23:18:01 +000044
bellardb9adb4a2003-04-29 20:41:16 +000045#endif /* _QEMU_DISAS_H */