disas.h 1.2 KB
Newer Older
B
bellard 已提交
1 2 3
#ifndef _QEMU_DISAS_H
#define _QEMU_DISAS_H

A
aliguori 已提交
4 5
#include "qemu-common.h"

B
Blue Swirl 已提交
6
#ifdef NEED_CPU_H
B
bellard 已提交
7
/* Disassemble this for me please... (debugging). */
B
bellard 已提交
8
void disas(FILE *out, void *code, unsigned long size);
9
void target_disas(FILE *out, target_ulong code, target_ulong size, int flags);
A
aliguori 已提交
10 11 12 13

/* The usual mess... FIXME: Remove this condition once dyngen-exec.h is gone */
#ifndef __DYNGEN_EXEC_H__
void monitor_disas(Monitor *mon, CPUState *env,
B
bellard 已提交
14
                   target_ulong pc, int nb_insn, int is_physical, int flags);
A
aliguori 已提交
15
#endif
B
bellard 已提交
16 17

/* Look up symbol for debugging purpose.  Returns "" if unknown. */
B
bellard 已提交
18
const char *lookup_symbol(target_ulong orig_addr);
B
Blue Swirl 已提交
19
#endif
B
bellard 已提交
20

21 22 23 24
struct syminfo;
struct elf32_sym;
struct elf64_sym;

P
Paul Brook 已提交
25 26 27
#if defined(CONFIG_USER_ONLY)
typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_ulong orig_addr);
#else
A
Anthony Liguori 已提交
28
typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_phys_addr_t orig_addr);
P
Paul Brook 已提交
29
#endif
30 31 32

struct syminfo {
    lookup_symbol_t lookup_symbol;
B
bellard 已提交
33
    unsigned int disas_num_syms;
34 35 36 37
    union {
      struct elf32_sym *elf32;
      struct elf64_sym *elf64;
    } disas_symtab;
B
bellard 已提交
38 39
    const char *disas_strtab;
    struct syminfo *next;
40 41 42 43
};

/* Filled in by elfload.c.  Simplistic, but will do for now. */
extern struct syminfo *syminfos;
B
bellard 已提交
44

B
bellard 已提交
45
#endif /* _QEMU_DISAS_H */