disasm.h revision 1.3
167754Smsmith/* Disassemble support for GDB. 267754Smsmith Copyright (C) 2002-2015 Free Software Foundation, Inc. 367754Smsmith 467754Smsmith This file is part of GDB. 567754Smsmith 667754Smsmith This program is free software; you can redistribute it and/or modify 7217365Sjkim it under the terms of the GNU General Public License as published by 8281075Sdim the Free Software Foundation; either version 3 of the License, or 970243Smsmith (at your option) any later version. 1067754Smsmith 11217365Sjkim This program is distributed in the hope that it will be useful, 12217365Sjkim but WITHOUT ANY WARRANTY; without even the implied warranty of 13217365Sjkim MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14217365Sjkim GNU General Public License for more details. 15217365Sjkim 16217365Sjkim You should have received a copy of the GNU General Public License 17217365Sjkim along with this program. If not, see <http://www.gnu.org/licenses/>. */ 18217365Sjkim 19217365Sjkim#ifndef DISASM_H 20217365Sjkim#define DISASM_H 21217365Sjkim 22217365Sjkim#include "dis-asm.h" 23217365Sjkim 24217365Sjkim#define DISASSEMBLY_SOURCE (0x1 << 0) 2567754Smsmith#define DISASSEMBLY_RAW_INSN (0x1 << 1) 26217365Sjkim#define DISASSEMBLY_OMIT_FNAME (0x1 << 2) 27217365Sjkim#define DISASSEMBLY_FILENAME (0x1 << 3) 28217365Sjkim#define DISASSEMBLY_OMIT_PC (0x1 << 4) 2967754Smsmith 30217365Sjkimstruct gdbarch; 31217365Sjkimstruct ui_out; 32217365Sjkimstruct ui_file; 33217365Sjkim 34217365Sjkim/* Return a filled in disassemble_info object for use by gdb. */ 35217365Sjkim 36217365Sjkimextern struct disassemble_info gdb_disassemble_info (struct gdbarch *gdbarch, 37217365Sjkim struct ui_file *file); 38217365Sjkim 39217365Sjkimextern void gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout, 40217365Sjkim char *file_string, int flags, int how_many, 41217365Sjkim CORE_ADDR low, CORE_ADDR high); 42217365Sjkim 4367754Smsmith/* Print the instruction at address MEMADDR in debugged memory, 4467754Smsmith on STREAM. Returns the length of the instruction, in bytes, 4567754Smsmith and, if requested, the number of branch delay slot instructions. */ 4667754Smsmith 4767754Smsmithextern int gdb_print_insn (struct gdbarch *gdbarch, CORE_ADDR memaddr, 48193267Sjkim struct ui_file *stream, int *branch_delay_insns); 49193267Sjkim 50193267Sjkim/* Return the length in bytes of the instruction at address MEMADDR in 5167754Smsmith debugged memory. */ 5267754Smsmith 5382367Smsmithextern int gdb_insn_length (struct gdbarch *gdbarch, CORE_ADDR memaddr); 5467754Smsmith 5577424Smsmith/* Return the length in bytes of INSN, originally at MEMADDR. MAX_LEN 5677424Smsmith is the size of the buffer containing INSN. */ 5777424Smsmith 5877424Smsmithextern int gdb_buffered_insn_length (struct gdbarch *gdbarch, 5977424Smsmith const gdb_byte *insn, int max_len, 6077424Smsmith CORE_ADDR memaddr); 6177424Smsmith 6277424Smsmith#endif 6377424Smsmith