xref: /dflybsd-src/contrib/gdb-7/gdb/disasm.h (revision de8e141f24382815c10a4012d209bbbf7abf1112)
15796c8dcSSimon Schubert /* Disassemble support for GDB.
2*ef5ccd6cSJohn Marino    Copyright (C) 2002-2013 Free Software Foundation, Inc.
35796c8dcSSimon Schubert 
45796c8dcSSimon Schubert    This file is part of GDB.
55796c8dcSSimon Schubert 
65796c8dcSSimon Schubert    This program is free software; you can redistribute it and/or modify
75796c8dcSSimon Schubert    it under the terms of the GNU General Public License as published by
85796c8dcSSimon Schubert    the Free Software Foundation; either version 3 of the License, or
95796c8dcSSimon Schubert    (at your option) any later version.
105796c8dcSSimon Schubert 
115796c8dcSSimon Schubert    This program is distributed in the hope that it will be useful,
125796c8dcSSimon Schubert    but WITHOUT ANY WARRANTY; without even the implied warranty of
135796c8dcSSimon Schubert    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
145796c8dcSSimon Schubert    GNU General Public License for more details.
155796c8dcSSimon Schubert 
165796c8dcSSimon Schubert    You should have received a copy of the GNU General Public License
175796c8dcSSimon Schubert    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
185796c8dcSSimon Schubert 
195796c8dcSSimon Schubert #ifndef DISASM_H
205796c8dcSSimon Schubert #define DISASM_H
215796c8dcSSimon Schubert 
225796c8dcSSimon Schubert #define DISASSEMBLY_SOURCE	(0x1 << 0)
235796c8dcSSimon Schubert #define DISASSEMBLY_RAW_INSN	(0x1 << 1)
24cf7f2e2dSJohn Marino #define DISASSEMBLY_OMIT_FNAME	(0x1 << 2)
25*ef5ccd6cSJohn Marino #define DISASSEMBLY_FILENAME	(0x1 << 3)
26*ef5ccd6cSJohn Marino #define DISASSEMBLY_OMIT_PC	(0x1 << 4)
275796c8dcSSimon Schubert 
285796c8dcSSimon Schubert struct ui_out;
295796c8dcSSimon Schubert struct ui_file;
305796c8dcSSimon Schubert 
315796c8dcSSimon Schubert extern void gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout,
32cf7f2e2dSJohn Marino 			     char *file_string, int flags, int how_many,
33cf7f2e2dSJohn Marino 			     CORE_ADDR low, CORE_ADDR high);
345796c8dcSSimon Schubert 
355796c8dcSSimon Schubert /* Print the instruction at address MEMADDR in debugged memory,
365796c8dcSSimon Schubert    on STREAM.  Returns the length of the instruction, in bytes,
375796c8dcSSimon Schubert    and, if requested, the number of branch delay slot instructions.  */
385796c8dcSSimon Schubert 
395796c8dcSSimon Schubert extern int gdb_print_insn (struct gdbarch *gdbarch, CORE_ADDR memaddr,
405796c8dcSSimon Schubert 			   struct ui_file *stream, int *branch_delay_insns);
415796c8dcSSimon Schubert 
42cf7f2e2dSJohn Marino /* Return the length in bytes of the instruction at address MEMADDR in
43cf7f2e2dSJohn Marino    debugged memory.  */
44cf7f2e2dSJohn Marino 
45cf7f2e2dSJohn Marino extern int gdb_insn_length (struct gdbarch *gdbarch, CORE_ADDR memaddr);
46cf7f2e2dSJohn Marino 
47cf7f2e2dSJohn Marino /* Return the length in bytes of INSN, originally at MEMADDR.  MAX_LEN
48cf7f2e2dSJohn Marino    is the size of the buffer containing INSN.  */
49cf7f2e2dSJohn Marino 
50cf7f2e2dSJohn Marino extern int gdb_buffered_insn_length (struct gdbarch *gdbarch,
51cf7f2e2dSJohn Marino 				     const gdb_byte *insn, int max_len,
52cf7f2e2dSJohn Marino 				     CORE_ADDR memaddr);
53cf7f2e2dSJohn Marino 
545796c8dcSSimon Schubert #endif
55