disas.h 1.14 KB
Newer Older
bellard's avatar
bellard committed
1 2 3
#ifndef _QEMU_DISAS_H
#define _QEMU_DISAS_H

aliguori's avatar
aliguori committed
4 5
#include "qemu-common.h"

Blue Swirl's avatar
Blue Swirl committed
6
#ifdef NEED_CPU_H
bellard's avatar
bellard committed
7
/* Disassemble this for me please... (debugging). */
bellard's avatar
bellard committed
8
void disas(FILE *out, void *code, unsigned long size);
9
void target_disas(FILE *out, target_ulong code, target_ulong size, int flags);
aliguori's avatar
aliguori committed
10

11
void monitor_disas(Monitor *mon, CPUArchState *env,
bellard's avatar
bellard committed
12
                   target_ulong pc, int nb_insn, int is_physical, int flags);
bellard's avatar
bellard committed
13 14

/* Look up symbol for debugging purpose.  Returns "" if unknown. */
bellard's avatar
bellard committed
15
const char *lookup_symbol(target_ulong orig_addr);
Blue Swirl's avatar
Blue Swirl committed
16
#endif
bellard's avatar
bellard committed
17

18 19 20 21
struct syminfo;
struct elf32_sym;
struct elf64_sym;

Paul Brook's avatar
Paul Brook committed
22 23 24
#if defined(CONFIG_USER_ONLY)
typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_ulong orig_addr);
#else
25
typedef const char *(*lookup_symbol_t)(struct syminfo *s, target_phys_addr_t orig_addr);
Paul Brook's avatar
Paul Brook committed
26
#endif
27 28 29

struct syminfo {
    lookup_symbol_t lookup_symbol;
bellard's avatar
bellard committed
30
    unsigned int disas_num_syms;
31 32 33 34
    union {
      struct elf32_sym *elf32;
      struct elf64_sym *elf64;
    } disas_symtab;
bellard's avatar
bellard committed
35 36
    const char *disas_strtab;
    struct syminfo *next;
37 38 39 40
};

/* Filled in by elfload.c.  Simplistic, but will do for now. */
extern struct syminfo *syminfos;
bellard's avatar
bellard committed
41

bellard's avatar
bellard committed
42
#endif /* _QEMU_DISAS_H */