2010-03-24 Stan Shebs <stan@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / gdbserver / mem-break.h
CommitLineData
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. */
26
d50171e4
PA
27/* Returns TRUE if breakpoints are supported on this target. */
28
29int breakpoints_supported (void);
30
31/* Returns TRUE if there's any breakpoint at ADDR in our tables,
32 inserted, or not. */
33
34int breakpoint_here (CORE_ADDR addr);
35
36/* Returns TRUE if there's any inserted breakpoint set at ADDR. */
37
38int breakpoint_inserted_here (CORE_ADDR addr);
39
611cb4a5 40/* Create a new breakpoint at WHERE, and call HANDLER when
b65d95c5
DJ
41 it is hit. HANDLER should return 1 if the breakpoint
42 should be deleted, 0 otherwise. */
611cb4a5
DJ
43
44void set_breakpoint_at (CORE_ADDR where,
b65d95c5 45 int (*handler) (CORE_ADDR));
611cb4a5 46
68070c10
PA
47/* Delete a breakpoint previously inserted at ADDR with
48 set_breakpoint_at. */
49
50void delete_breakpoint_at (CORE_ADDR addr);
51
d50171e4
PA
52/* Set a reinsert breakpoint at STOP_AT. */
53
54void set_reinsert_breakpoint (CORE_ADDR stop_at);
55
56/* Delete all reinsert breakpoints. */
611cb4a5 57
d50171e4 58void delete_reinsert_breakpoints (void);
611cb4a5 59
d50171e4
PA
60/* Reinsert breakpoints at WHERE (and change their status to
61 inserted). */
611cb4a5 62
d50171e4 63void reinsert_breakpoints_at (CORE_ADDR where);
611cb4a5 64
d50171e4
PA
65/* Uninsert breakpoints at WHERE (and change their status to
66 uninserted). This still leaves the breakpoints in the table. */
611cb4a5 67
d50171e4 68void uninsert_breakpoints_at (CORE_ADDR where);
611cb4a5
DJ
69
70/* See if any breakpoint claims ownership of STOP_PC. Call the handler for
71 the breakpoint, if found. */
72
d50171e4 73void check_breakpoints (CORE_ADDR stop_pc);
611cb4a5
DJ
74
75/* See if any breakpoints shadow the target memory area from MEM_ADDR
76 to MEM_ADDR + MEM_LEN. Update the data already read from the target
77 (in BUF) if necessary. */
78
f450004a 79void check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len);
611cb4a5
DJ
80
81/* See if any breakpoints shadow the target memory area from MEM_ADDR
82 to MEM_ADDR + MEM_LEN. Update the data to be written to the target
83 (in BUF) if necessary, as well as the original data for any breakpoints. */
84
f450004a 85void check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len);
611cb4a5
DJ
86
87/* Set the byte pattern to insert for memory breakpoints. This function
88 must be called before any breakpoints are set. */
89
f450004a 90void set_breakpoint_data (const unsigned char *bp_data, int bp_len);
611cb4a5 91
ae13219e
DJ
92/* Delete all breakpoints. */
93
94void delete_all_breakpoints (void);
95
95954743
PA
96/* Delete all breakpoints, but do not try to un-insert them from the
97 inferior. */
98
99void free_all_breakpoints (struct process_info *proc);
100
611cb4a5 101#endif /* MEM_BREAK_H */
This page took 0.580671 seconds and 4 git commands to generate.