1130803Smarcel/* Memory breakpoint interfaces for the remote server for GDB. 2130803Smarcel Copyright 2002 3130803Smarcel Free Software Foundation, Inc. 4130803Smarcel 5130803Smarcel Contributed by MontaVista Software. 6130803Smarcel 7130803Smarcel This file is part of GDB. 8130803Smarcel 9130803Smarcel This program is free software; you can redistribute it and/or modify 10130803Smarcel it under the terms of the GNU General Public License as published by 11130803Smarcel the Free Software Foundation; either version 2 of the License, or 12130803Smarcel (at your option) any later version. 13130803Smarcel 14130803Smarcel This program is distributed in the hope that it will be useful, 15130803Smarcel but WITHOUT ANY WARRANTY; without even the implied warranty of 16130803Smarcel MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17130803Smarcel GNU General Public License for more details. 18130803Smarcel 19130803Smarcel You should have received a copy of the GNU General Public License 20130803Smarcel along with this program; if not, write to the Free Software 21130803Smarcel Foundation, Inc., 59 Temple Place - Suite 330, 22130803Smarcel Boston, MA 02111-1307, USA. */ 23130803Smarcel 24130803Smarcel#ifndef MEM_BREAK_H 25130803Smarcel#define MEM_BREAK_H 26130803Smarcel 27130803Smarcel/* Breakpoints are opaque. */ 28130803Smarcel 29130803Smarcel/* Create a new breakpoint at WHERE, and call HANDLER when 30130803Smarcel it is hit. */ 31130803Smarcel 32130803Smarcelvoid set_breakpoint_at (CORE_ADDR where, 33130803Smarcel void (*handler) (CORE_ADDR)); 34130803Smarcel 35130803Smarcel/* Create a reinsertion breakpoint at STOP_AT for the breakpoint 36130803Smarcel currently at STOP_PC (and temporarily remove the breakpoint at 37130803Smarcel STOP_PC). */ 38130803Smarcel 39130803Smarcelvoid reinsert_breakpoint_by_bp (CORE_ADDR stop_pc, CORE_ADDR stop_at); 40130803Smarcel 41130803Smarcel/* Change the status of the breakpoint at WHERE to inserted. */ 42130803Smarcel 43130803Smarcelvoid reinsert_breakpoint (CORE_ADDR where); 44130803Smarcel 45130803Smarcel/* Change the status of the breakpoint at WHERE to uninserted. */ 46130803Smarcel 47130803Smarcelvoid uninsert_breakpoint (CORE_ADDR where); 48130803Smarcel 49130803Smarcel/* See if any breakpoint claims ownership of STOP_PC. Call the handler for 50130803Smarcel the breakpoint, if found. */ 51130803Smarcel 52130803Smarcelint check_breakpoints (CORE_ADDR stop_pc); 53130803Smarcel 54130803Smarcel/* See if any breakpoints shadow the target memory area from MEM_ADDR 55130803Smarcel to MEM_ADDR + MEM_LEN. Update the data already read from the target 56130803Smarcel (in BUF) if necessary. */ 57130803Smarcel 58130803Smarcelvoid check_mem_read (CORE_ADDR mem_addr, char *buf, int mem_len); 59130803Smarcel 60130803Smarcel/* See if any breakpoints shadow the target memory area from MEM_ADDR 61130803Smarcel to MEM_ADDR + MEM_LEN. Update the data to be written to the target 62130803Smarcel (in BUF) if necessary, as well as the original data for any breakpoints. */ 63130803Smarcel 64130803Smarcelvoid check_mem_write (CORE_ADDR mem_addr, char *buf, int mem_len); 65130803Smarcel 66130803Smarcel/* Set the byte pattern to insert for memory breakpoints. This function 67130803Smarcel must be called before any breakpoints are set. */ 68130803Smarcel 69130803Smarcelvoid set_breakpoint_data (const char *bp_data, int bp_len); 70130803Smarcel 71130803Smarcel#endif /* MEM_BREAK_H */ 72