* breakpoint.c (bpstat_print, bpstat_stop_status): Change to walk the
[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
57dis_asm_read_memory PARAMS ((bfd_vma memaddr, bfd_byte *myaddr, int len));
58
59/* GDB--Like memory_error with slightly different parameters. */
60extern void
61dis_asm_memory_error
5128f892 62 PARAMS ((int status, bfd_vma memaddr, disassemble_info *info));
d7e1be46
PB
63
64#define GDB_INIT_DISASSEMBLE_INFO(INFO, STREAM) \
5d0734a7
JK
65 (INFO).fprintf_func = (fprintf_ftype)fprintf_filtered, \
66 (INFO).stream = (STREAM), \
67 (INFO).read_memory_func = dis_asm_read_memory, \
68 (INFO).memory_error_func = dis_asm_memory_error
69
70
71/* Standard disassemblers. Disassemble one instruction at the given
72 target address. Return number of bytes processed. */
73typedef int (*disassembler_ftype)
74 PARAMS((bfd_vma, disassemble_info *));
75
76extern int print_insn_big_mips PARAMS ((bfd_vma, disassemble_info*));
77extern int print_insn_little_mips PARAMS ((bfd_vma,disassemble_info*));
78extern int print_insn_i386 PARAMS ((bfd_vma,disassemble_info*));
79extern int print_insn_m68k PARAMS ((bfd_vma,disassemble_info*));
80extern int print_insn_z8001 PARAMS ((bfd_vma,disassemble_info*));
81extern int print_insn_z8002 PARAMS ((bfd_vma,disassemble_info*));
82extern int print_insn_h8500 PARAMS ((bfd_vma,disassemble_info*));
f7ed13c7 83extern int print_insn_sparc PARAMS ((bfd_vma,disassemble_info*));
This page took 0.026134 seconds and 4 git commands to generate.