15796c8dcSSimon Schubert /* Disassemble support for GDB. 2*cf7f2e2dSJohn Marino Copyright (C) 2002, 2007, 2008, 2009, 2010 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) 24*cf7f2e2dSJohn Marino #define DISASSEMBLY_OMIT_FNAME (0x1 << 2) 255796c8dcSSimon Schubert 265796c8dcSSimon Schubert struct ui_out; 275796c8dcSSimon Schubert struct ui_file; 285796c8dcSSimon Schubert 295796c8dcSSimon Schubert extern void gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout, 30*cf7f2e2dSJohn Marino char *file_string, int flags, int how_many, 31*cf7f2e2dSJohn Marino CORE_ADDR low, CORE_ADDR high); 325796c8dcSSimon Schubert 335796c8dcSSimon Schubert /* Print the instruction at address MEMADDR in debugged memory, 345796c8dcSSimon Schubert on STREAM. Returns the length of the instruction, in bytes, 355796c8dcSSimon Schubert and, if requested, the number of branch delay slot instructions. */ 365796c8dcSSimon Schubert 375796c8dcSSimon Schubert extern int gdb_print_insn (struct gdbarch *gdbarch, CORE_ADDR memaddr, 385796c8dcSSimon Schubert struct ui_file *stream, int *branch_delay_insns); 395796c8dcSSimon Schubert 40*cf7f2e2dSJohn Marino /* Return the length in bytes of the instruction at address MEMADDR in 41*cf7f2e2dSJohn Marino debugged memory. */ 42*cf7f2e2dSJohn Marino 43*cf7f2e2dSJohn Marino extern int gdb_insn_length (struct gdbarch *gdbarch, CORE_ADDR memaddr); 44*cf7f2e2dSJohn Marino 45*cf7f2e2dSJohn Marino /* Return the length in bytes of INSN, originally at MEMADDR. MAX_LEN 46*cf7f2e2dSJohn Marino is the size of the buffer containing INSN. */ 47*cf7f2e2dSJohn Marino 48*cf7f2e2dSJohn Marino extern int gdb_buffered_insn_length (struct gdbarch *gdbarch, 49*cf7f2e2dSJohn Marino const gdb_byte *insn, int max_len, 50*cf7f2e2dSJohn Marino CORE_ADDR memaddr); 51*cf7f2e2dSJohn Marino 525796c8dcSSimon Schubert #endif 53