Commit | Line | Data |
---|---|---|
611cb4a5 | 1 | /* Memory breakpoint interfaces for the remote server for GDB. |
0fb0cc75 | 2 | Copyright (C) 2002, 2005, 2007, 2008, 2009 Free Software Foundation, Inc. |
611cb4a5 DJ |
3 | |
4 | Contributed by MontaVista Software. | |
5 | ||
6 | This file is part of GDB. | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
a9762ec7 | 10 | the Free Software Foundation; either version 3 of the License, or |
611cb4a5 DJ |
11 | (at your option) any later version. |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
a9762ec7 | 19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
611cb4a5 DJ |
20 | |
21 | #ifndef MEM_BREAK_H | |
22 | #define MEM_BREAK_H | |
23 | ||
24 | /* Breakpoints are opaque. */ | |
25 | ||
26 | /* Create a new breakpoint at WHERE, and call HANDLER when | |
b65d95c5 DJ |
27 | it is hit. HANDLER should return 1 if the breakpoint |
28 | should be deleted, 0 otherwise. */ | |
611cb4a5 DJ |
29 | |
30 | void set_breakpoint_at (CORE_ADDR where, | |
b65d95c5 | 31 | int (*handler) (CORE_ADDR)); |
611cb4a5 | 32 | |
68070c10 PA |
33 | /* Delete a breakpoint previously inserted at ADDR with |
34 | set_breakpoint_at. */ | |
35 | ||
36 | void delete_breakpoint_at (CORE_ADDR addr); | |
37 | ||
611cb4a5 DJ |
38 | /* Create a reinsertion breakpoint at STOP_AT for the breakpoint |
39 | currently at STOP_PC (and temporarily remove the breakpoint at | |
40 | STOP_PC). */ | |
41 | ||
42 | void reinsert_breakpoint_by_bp (CORE_ADDR stop_pc, CORE_ADDR stop_at); | |
43 | ||
44 | /* Change the status of the breakpoint at WHERE to inserted. */ | |
45 | ||
46 | void reinsert_breakpoint (CORE_ADDR where); | |
47 | ||
48 | /* Change the status of the breakpoint at WHERE to uninserted. */ | |
49 | ||
50 | void uninsert_breakpoint (CORE_ADDR where); | |
51 | ||
52 | /* See if any breakpoint claims ownership of STOP_PC. Call the handler for | |
53 | the breakpoint, if found. */ | |
54 | ||
55 | int check_breakpoints (CORE_ADDR stop_pc); | |
56 | ||
57 | /* See if any breakpoints shadow the target memory area from MEM_ADDR | |
58 | to MEM_ADDR + MEM_LEN. Update the data already read from the target | |
59 | (in BUF) if necessary. */ | |
60 | ||
f450004a | 61 | void check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len); |
611cb4a5 DJ |
62 | |
63 | /* See if any breakpoints shadow the target memory area from MEM_ADDR | |
64 | to MEM_ADDR + MEM_LEN. Update the data to be written to the target | |
65 | (in BUF) if necessary, as well as the original data for any breakpoints. */ | |
66 | ||
f450004a | 67 | void check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len); |
611cb4a5 DJ |
68 | |
69 | /* Set the byte pattern to insert for memory breakpoints. This function | |
70 | must be called before any breakpoints are set. */ | |
71 | ||
f450004a | 72 | void set_breakpoint_data (const unsigned char *bp_data, int bp_len); |
611cb4a5 | 73 | |
ae13219e DJ |
74 | /* Delete all breakpoints. */ |
75 | ||
76 | void delete_all_breakpoints (void); | |
77 | ||
611cb4a5 | 78 | #endif /* MEM_BREAK_H */ |