xref: /openbsd-src/gnu/usr.bin/binutils/gdb/gdbserver/mem-break.h (revision b725ae7711052a2233e31a66fefb8a752c388d7a)
1 /* Memory breakpoint interfaces for the remote server for GDB.
2    Copyright 2002
3    Free Software Foundation, Inc.
4 
5    Contributed by MontaVista Software.
6 
7    This file is part of GDB.
8 
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13 
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18 
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 59 Temple Place - Suite 330,
22    Boston, MA 02111-1307, USA.  */
23 
24 #ifndef MEM_BREAK_H
25 #define MEM_BREAK_H
26 
27 /* Breakpoints are opaque.  */
28 
29 /* Create a new breakpoint at WHERE, and call HANDLER when
30    it is hit.  */
31 
32 void set_breakpoint_at (CORE_ADDR where,
33 			void (*handler) (CORE_ADDR));
34 
35 /* Create a reinsertion breakpoint at STOP_AT for the breakpoint
36    currently at STOP_PC (and temporarily remove the breakpoint at
37    STOP_PC).  */
38 
39 void reinsert_breakpoint_by_bp (CORE_ADDR stop_pc, CORE_ADDR stop_at);
40 
41 /* Change the status of the breakpoint at WHERE to inserted.  */
42 
43 void reinsert_breakpoint (CORE_ADDR where);
44 
45 /* Change the status of the breakpoint at WHERE to uninserted.  */
46 
47 void uninsert_breakpoint (CORE_ADDR where);
48 
49 /* See if any breakpoint claims ownership of STOP_PC.  Call the handler for
50    the breakpoint, if found.  */
51 
52 int check_breakpoints (CORE_ADDR stop_pc);
53 
54 /* See if any breakpoints shadow the target memory area from MEM_ADDR
55    to MEM_ADDR + MEM_LEN.  Update the data already read from the target
56    (in BUF) if necessary.  */
57 
58 void check_mem_read (CORE_ADDR mem_addr, char *buf, int mem_len);
59 
60 /* See if any breakpoints shadow the target memory area from MEM_ADDR
61    to MEM_ADDR + MEM_LEN.  Update the data to be written to the target
62    (in BUF) if necessary, as well as the original data for any breakpoints.  */
63 
64 void check_mem_write (CORE_ADDR mem_addr, char *buf, int mem_len);
65 
66 /* Set the byte pattern to insert for memory breakpoints.  This function
67    must be called before any breakpoints are set.  */
68 
69 void set_breakpoint_data (const char *bp_data, int bp_len);
70 
71 #endif /* MEM_BREAK_H */
72