(int64e_type): Fix definition.
[deliverable/binutils-gdb.git] / include / dis-asm.h
CommitLineData
d7e1be46
PB
1#include <stdio.h>
2#include "ansidecl.h"
3#include "bfd.h"
4
5typedef int (*fprintf_ftype) PARAMS((FILE*, const char*, ...));
6
7typedef struct disassemble_info {
8 fprintf_ftype fprintf_func;
9 FILE *stream;
5d0734a7
JK
10
11 /* For use by the disassembler. */
d7e1be46 12 int flags;
5d0734a7
JK
13 PTR private_data;
14
15 /* Function used to get bytes to disassemble. MEMADDR is the
16 address of the stuff to be disassembled, MYADDR is the address to
17 put the bytes in, and LENGTH is the number of bytes to read.
18 INFO is a pointer to this struct.
19 Returns an errno value or 0 for success. */
20 int (*read_memory_func)
21 PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, int length,
22 struct disassemble_info *info));
23
24 /* Function which should be called if we get an error that we can't
25 recover from. STATUS is the errno value from read_memory_func and
26 MEMADDR is the address that we were trying to read. INFO is a
27 pointer to this struct. */
28 void (*memory_error_func)
29 PARAMS ((int status, bfd_vma memaddr, struct disassemble_info *info));
30
31 /* These are for buffer_read_memory. */
32 bfd_byte *buffer;
33 bfd_vma buffer_vma;
34 int buffer_length;
d7e1be46
PB
35} disassemble_info;
36
5d0734a7
JK
37/* Here is a function which callers may wish to use for read_memory_func.
38 It gets bytes from a buffer. */
39extern int buffer_read_memory
40 PARAMS ((bfd_vma, bfd_byte *, int, struct disassemble_info *));
41
42/* This function goes with buffer_read_memory.
43 It prints a message using info->fprintf_func and info->stream. */
44extern void perror_memory PARAMS ((int, bfd_vma, struct disassemble_info *));
d7e1be46
PB
45
46#define INIT_DISASSEMBLE_INFO(INFO, STREAM) \
5d0734a7
JK
47 (INFO).fprintf_func = (fprintf_ftype)fprintf, \
48 (INFO).stream = (STREAM), \
49 (INFO).buffer = NULL, \
50 (INFO).buffer_vma = 0, \
51 (INFO).buffer_length = 0, \
52 (INFO).read_memory_func = buffer_read_memory, \
53 (INFO).memory_error_func = perror_memory
54
55/* GDB--Like target_read_memory, but slightly different parameters. */
56extern int
a6cead71
JK
57dis_asm_read_memory PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, int len,
58 disassemble_info *info));
5d0734a7
JK
59
60/* GDB--Like memory_error with slightly different parameters. */
61extern void
62dis_asm_memory_error
5128f892 63 PARAMS ((int status, bfd_vma memaddr, disassemble_info *info));
d7e1be46
PB
64
65#define GDB_INIT_DISASSEMBLE_INFO(INFO, STREAM) \
5d0734a7
JK
66 (INFO).fprintf_func = (fprintf_ftype)fprintf_filtered, \
67 (INFO).stream = (STREAM), \
68 (INFO).read_memory_func = dis_asm_read_memory, \
69 (INFO).memory_error_func = dis_asm_memory_error
70
71
72/* Standard disassemblers. Disassemble one instruction at the given
73 target address. Return number of bytes processed. */
74typedef int (*disassembler_ftype)
75 PARAMS((bfd_vma, disassemble_info *));
76
77extern int print_insn_big_mips PARAMS ((bfd_vma, disassemble_info*));
78extern int print_insn_little_mips PARAMS ((bfd_vma,disassemble_info*));
79extern int print_insn_i386 PARAMS ((bfd_vma,disassemble_info*));
80extern int print_insn_m68k PARAMS ((bfd_vma,disassemble_info*));
81extern int print_insn_z8001 PARAMS ((bfd_vma,disassemble_info*));
82extern int print_insn_z8002 PARAMS ((bfd_vma,disassemble_info*));
83extern int print_insn_h8500 PARAMS ((bfd_vma,disassemble_info*));
f7ed13c7 84extern int print_insn_sparc PARAMS ((bfd_vma,disassemble_info*));
This page took 0.063881 seconds and 4 git commands to generate.