Commit | Line | Data |
---|---|---|
611cb4a5 | 1 | /* Memory breakpoint interfaces for the remote server for GDB. |
4c38e0a4 JB |
2 | Copyright (C) 2002, 2005, 2007, 2008, 2009, 2010 |
3 | Free Software Foundation, Inc. | |
611cb4a5 DJ |
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 | |
a9762ec7 | 11 | the Free Software Foundation; either version 3 of the License, or |
611cb4a5 DJ |
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 | |
a9762ec7 | 20 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
611cb4a5 DJ |
21 | |
22 | #ifndef MEM_BREAK_H | |
23 | #define MEM_BREAK_H | |
24 | ||
25 | /* Breakpoints are opaque. */ | |
414a389f | 26 | struct breakpoint; |
fa593d66 | 27 | struct fast_tracepoint_jump; |
611cb4a5 | 28 | |
8b07ae33 PA |
29 | /* Create a new GDB breakpoint at WHERE. Returns -1 if breakpoints |
30 | are not supported on this target, 0 otherwise. */ | |
d50171e4 | 31 | |
8b07ae33 | 32 | int set_gdb_breakpoint_at (CORE_ADDR where); |
d50171e4 PA |
33 | |
34 | /* Returns TRUE if there's any breakpoint at ADDR in our tables, | |
35 | inserted, or not. */ | |
36 | ||
37 | int breakpoint_here (CORE_ADDR addr); | |
38 | ||
39 | /* Returns TRUE if there's any inserted breakpoint set at ADDR. */ | |
40 | ||
41 | int breakpoint_inserted_here (CORE_ADDR addr); | |
42 | ||
8b07ae33 PA |
43 | /* Returns TRUE if there's a GDB breakpoint set at ADDR. */ |
44 | ||
45 | int gdb_breakpoint_here (CORE_ADDR where); | |
46 | ||
611cb4a5 | 47 | /* Create a new breakpoint at WHERE, and call HANDLER when |
b65d95c5 DJ |
48 | it is hit. HANDLER should return 1 if the breakpoint |
49 | should be deleted, 0 otherwise. */ | |
611cb4a5 | 50 | |
414a389f PA |
51 | struct breakpoint *set_breakpoint_at (CORE_ADDR where, |
52 | int (*handler) (CORE_ADDR)); | |
611cb4a5 | 53 | |
8b07ae33 PA |
54 | /* Delete a GDB breakpoint previously inserted at ADDR with |
55 | set_gdb_breakpoint_at. */ | |
68070c10 | 56 | |
8b07ae33 | 57 | int delete_gdb_breakpoint_at (CORE_ADDR addr); |
68070c10 | 58 | |
219f2f23 PA |
59 | /* Delete a breakpoint. */ |
60 | ||
61 | int delete_breakpoint (struct breakpoint *bkpt); | |
62 | ||
d50171e4 PA |
63 | /* Set a reinsert breakpoint at STOP_AT. */ |
64 | ||
65 | void set_reinsert_breakpoint (CORE_ADDR stop_at); | |
66 | ||
67 | /* Delete all reinsert breakpoints. */ | |
611cb4a5 | 68 | |
d50171e4 | 69 | void delete_reinsert_breakpoints (void); |
611cb4a5 | 70 | |
d50171e4 PA |
71 | /* Reinsert breakpoints at WHERE (and change their status to |
72 | inserted). */ | |
611cb4a5 | 73 | |
d50171e4 | 74 | void reinsert_breakpoints_at (CORE_ADDR where); |
611cb4a5 | 75 | |
d50171e4 PA |
76 | /* Uninsert breakpoints at WHERE (and change their status to |
77 | uninserted). This still leaves the breakpoints in the table. */ | |
611cb4a5 | 78 | |
d50171e4 | 79 | void uninsert_breakpoints_at (CORE_ADDR where); |
611cb4a5 DJ |
80 | |
81 | /* See if any breakpoint claims ownership of STOP_PC. Call the handler for | |
82 | the breakpoint, if found. */ | |
83 | ||
d50171e4 | 84 | void check_breakpoints (CORE_ADDR stop_pc); |
611cb4a5 DJ |
85 | |
86 | /* See if any breakpoints shadow the target memory area from MEM_ADDR | |
87 | to MEM_ADDR + MEM_LEN. Update the data already read from the target | |
88 | (in BUF) if necessary. */ | |
89 | ||
f450004a | 90 | void check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len); |
611cb4a5 DJ |
91 | |
92 | /* See if any breakpoints shadow the target memory area from MEM_ADDR | |
93 | to MEM_ADDR + MEM_LEN. Update the data to be written to the target | |
94 | (in BUF) if necessary, as well as the original data for any breakpoints. */ | |
95 | ||
f450004a | 96 | void check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len); |
611cb4a5 DJ |
97 | |
98 | /* Set the byte pattern to insert for memory breakpoints. This function | |
99 | must be called before any breakpoints are set. */ | |
100 | ||
f450004a | 101 | void set_breakpoint_data (const unsigned char *bp_data, int bp_len); |
611cb4a5 | 102 | |
ae13219e DJ |
103 | /* Delete all breakpoints. */ |
104 | ||
105 | void delete_all_breakpoints (void); | |
106 | ||
f9e39928 PA |
107 | /* Clear the "inserted" flag in all breakpoints of PROC. */ |
108 | ||
109 | void mark_breakpoints_out (struct process_info *proc); | |
110 | ||
95954743 PA |
111 | /* Delete all breakpoints, but do not try to un-insert them from the |
112 | inferior. */ | |
113 | ||
114 | void free_all_breakpoints (struct process_info *proc); | |
115 | ||
d3bbe7a0 PA |
116 | /* Check if breakpoints still seem to be inserted in the inferior. */ |
117 | ||
118 | void validate_breakpoints (void); | |
119 | ||
fa593d66 PA |
120 | /* Insert a fast tracepoint jump at WHERE, using instruction INSN, of |
121 | LENGTH bytes. */ | |
122 | ||
123 | struct fast_tracepoint_jump *set_fast_tracepoint_jump (CORE_ADDR where, | |
124 | unsigned char *insn, | |
125 | ULONGEST length); | |
126 | ||
127 | /* Delete fast tracepoint jump TODEL from our tables, and uninsert if | |
128 | from memory. */ | |
129 | ||
130 | int delete_fast_tracepoint_jump (struct fast_tracepoint_jump *todel); | |
131 | ||
132 | /* Returns true if there's fast tracepoint jump set at WHERE. */ | |
133 | ||
134 | int fast_tracepoint_jump_here (CORE_ADDR); | |
135 | ||
136 | /* Uninsert fast tracepoint jumps at WHERE (and change their status to | |
137 | uninserted). This still leaves the tracepoints in the table. */ | |
138 | ||
139 | void uninsert_fast_tracepoint_jumps_at (CORE_ADDR pc); | |
140 | ||
141 | /* Reinsert fast tracepoint jumps at WHERE (and change their status to | |
142 | inserted). */ | |
143 | ||
144 | void reinsert_fast_tracepoint_jumps_at (CORE_ADDR where); | |
145 | ||
611cb4a5 | 146 | #endif /* MEM_BREAK_H */ |