bfd/ChangeLog
[deliverable/binutils-gdb.git] / gdb / gdbserver / mem-break.h
CommitLineData
611cb4a5 1/* Memory breakpoint interfaces for the remote server for GDB.
ecd75fc8 2 Copyright (C) 2002-2014 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. */
414a389f 25struct breakpoint;
fa593d66 26struct fast_tracepoint_jump;
611cb4a5 27
9f3a5c85
LM
28/* Locate a breakpoint placed at address WHERE and return a pointer
29 to its structure. */
30
31struct breakpoint *find_gdb_breakpoint_at (CORE_ADDR where);
32
8b07ae33
PA
33/* Create a new GDB breakpoint at WHERE. Returns -1 if breakpoints
34 are not supported on this target, 0 otherwise. */
d50171e4 35
8b07ae33 36int set_gdb_breakpoint_at (CORE_ADDR where);
d50171e4
PA
37
38/* Returns TRUE if there's any breakpoint at ADDR in our tables,
39 inserted, or not. */
40
41int breakpoint_here (CORE_ADDR addr);
42
43/* Returns TRUE if there's any inserted breakpoint set at ADDR. */
44
45int breakpoint_inserted_here (CORE_ADDR addr);
46
9f3a5c85
LM
47/* Clear all breakpoint conditions associated with this address. */
48
49void clear_gdb_breakpoint_conditions (CORE_ADDR addr);
50
51/* Set target-side condition CONDITION to the breakpoint at ADDR. */
52
53int add_breakpoint_condition (CORE_ADDR addr, char **condition);
54
d3ce09f5
SS
55int add_breakpoint_commands (CORE_ADDR addr, char **commands, int persist);
56
57int any_persistent_commands (void);
58
9f3a5c85
LM
59/* Evaluation condition (if any) at breakpoint BP. Return 1 if
60 true and 0 otherwise. */
61
62int gdb_condition_true_at_breakpoint (CORE_ADDR where);
63
d3ce09f5
SS
64int gdb_no_commands_at_breakpoint (CORE_ADDR where);
65
66void run_breakpoint_commands (CORE_ADDR where);
67
8b07ae33
PA
68/* Returns TRUE if there's a GDB breakpoint set at ADDR. */
69
70int gdb_breakpoint_here (CORE_ADDR where);
71
611cb4a5 72/* Create a new breakpoint at WHERE, and call HANDLER when
b65d95c5
DJ
73 it is hit. HANDLER should return 1 if the breakpoint
74 should be deleted, 0 otherwise. */
611cb4a5 75
414a389f
PA
76struct breakpoint *set_breakpoint_at (CORE_ADDR where,
77 int (*handler) (CORE_ADDR));
611cb4a5 78
8b07ae33
PA
79/* Delete a GDB breakpoint previously inserted at ADDR with
80 set_gdb_breakpoint_at. */
68070c10 81
8b07ae33 82int delete_gdb_breakpoint_at (CORE_ADDR addr);
68070c10 83
219f2f23
PA
84/* Delete a breakpoint. */
85
86int delete_breakpoint (struct breakpoint *bkpt);
87
d50171e4
PA
88/* Set a reinsert breakpoint at STOP_AT. */
89
90void set_reinsert_breakpoint (CORE_ADDR stop_at);
91
92/* Delete all reinsert breakpoints. */
611cb4a5 93
d50171e4 94void delete_reinsert_breakpoints (void);
611cb4a5 95
d50171e4
PA
96/* Reinsert breakpoints at WHERE (and change their status to
97 inserted). */
611cb4a5 98
d50171e4 99void reinsert_breakpoints_at (CORE_ADDR where);
611cb4a5 100
d50171e4
PA
101/* Uninsert breakpoints at WHERE (and change their status to
102 uninserted). This still leaves the breakpoints in the table. */
611cb4a5 103
d50171e4 104void uninsert_breakpoints_at (CORE_ADDR where);
611cb4a5 105
0fb4aa4b
PA
106/* Reinsert all breakpoints of the current process (and change their
107 status to inserted). */
108
109void reinsert_all_breakpoints (void);
110
111/* Uninsert all breakpoints of the current process (and change their
112 status to uninserted). This still leaves the breakpoints in the
113 table. */
114
115void uninsert_all_breakpoints (void);
116
611cb4a5
DJ
117/* See if any breakpoint claims ownership of STOP_PC. Call the handler for
118 the breakpoint, if found. */
119
d50171e4 120void check_breakpoints (CORE_ADDR stop_pc);
611cb4a5
DJ
121
122/* See if any breakpoints shadow the target memory area from MEM_ADDR
123 to MEM_ADDR + MEM_LEN. Update the data already read from the target
124 (in BUF) if necessary. */
125
f450004a 126void check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len);
611cb4a5
DJ
127
128/* See if any breakpoints shadow the target memory area from MEM_ADDR
129 to MEM_ADDR + MEM_LEN. Update the data to be written to the target
b9fd1791
PA
130 (in BUF, a copy of MYADDR on entry) if necessary, as well as the
131 original data for any breakpoints. */
611cb4a5 132
b9fd1791
PA
133void check_mem_write (CORE_ADDR mem_addr,
134 unsigned char *buf, const unsigned char *myaddr, int mem_len);
611cb4a5
DJ
135
136/* Set the byte pattern to insert for memory breakpoints. This function
137 must be called before any breakpoints are set. */
138
f450004a 139void set_breakpoint_data (const unsigned char *bp_data, int bp_len);
611cb4a5 140
ae13219e
DJ
141/* Delete all breakpoints. */
142
143void delete_all_breakpoints (void);
144
f9e39928
PA
145/* Clear the "inserted" flag in all breakpoints of PROC. */
146
147void mark_breakpoints_out (struct process_info *proc);
148
95954743
PA
149/* Delete all breakpoints, but do not try to un-insert them from the
150 inferior. */
151
152void free_all_breakpoints (struct process_info *proc);
153
d3bbe7a0
PA
154/* Check if breakpoints still seem to be inserted in the inferior. */
155
156void validate_breakpoints (void);
157
fa593d66
PA
158/* Insert a fast tracepoint jump at WHERE, using instruction INSN, of
159 LENGTH bytes. */
160
161struct fast_tracepoint_jump *set_fast_tracepoint_jump (CORE_ADDR where,
162 unsigned char *insn,
163 ULONGEST length);
164
5c73ff4e
YQ
165/* Increment reference counter of JP. */
166void inc_ref_fast_tracepoint_jump (struct fast_tracepoint_jump *jp);
167
fa593d66
PA
168/* Delete fast tracepoint jump TODEL from our tables, and uninsert if
169 from memory. */
170
171int delete_fast_tracepoint_jump (struct fast_tracepoint_jump *todel);
172
173/* Returns true if there's fast tracepoint jump set at WHERE. */
174
175int fast_tracepoint_jump_here (CORE_ADDR);
176
177/* Uninsert fast tracepoint jumps at WHERE (and change their status to
178 uninserted). This still leaves the tracepoints in the table. */
179
180void uninsert_fast_tracepoint_jumps_at (CORE_ADDR pc);
181
182/* Reinsert fast tracepoint jumps at WHERE (and change their status to
183 inserted). */
184
185void reinsert_fast_tracepoint_jumps_at (CORE_ADDR where);
186
611cb4a5 187#endif /* MEM_BREAK_H */
This page took 0.997725 seconds and 4 git commands to generate.