* linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
[deliverable/binutils-gdb.git] / gdb / gdbserver / mem-break.h
1 /* Memory breakpoint interfaces for the remote server for GDB.
2 Copyright (C) 2002, 2005, 2007, 2008, 2009, 2010
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 3 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, see <http://www.gnu.org/licenses/>. */
21
22 #ifndef MEM_BREAK_H
23 #define MEM_BREAK_H
24
25 /* Breakpoints are opaque. */
26 struct breakpoint;
27
28 /* Create a new GDB breakpoint at WHERE. Returns -1 if breakpoints
29 are not supported on this target, 0 otherwise. */
30
31 int set_gdb_breakpoint_at (CORE_ADDR where);
32
33 /* Returns TRUE if there's any breakpoint at ADDR in our tables,
34 inserted, or not. */
35
36 int breakpoint_here (CORE_ADDR addr);
37
38 /* Returns TRUE if there's any inserted breakpoint set at ADDR. */
39
40 int breakpoint_inserted_here (CORE_ADDR addr);
41
42 /* Returns TRUE if there's a GDB breakpoint set at ADDR. */
43
44 int gdb_breakpoint_here (CORE_ADDR where);
45
46 /* Create a new breakpoint at WHERE, and call HANDLER when
47 it is hit. HANDLER should return 1 if the breakpoint
48 should be deleted, 0 otherwise. */
49
50 struct breakpoint *set_breakpoint_at (CORE_ADDR where,
51 int (*handler) (CORE_ADDR));
52
53 /* Delete a GDB breakpoint previously inserted at ADDR with
54 set_gdb_breakpoint_at. */
55
56 int delete_gdb_breakpoint_at (CORE_ADDR addr);
57
58 /* Delete a breakpoint. */
59
60 int delete_breakpoint (struct breakpoint *bkpt);
61
62 /* Set a reinsert breakpoint at STOP_AT. */
63
64 void set_reinsert_breakpoint (CORE_ADDR stop_at);
65
66 /* Delete all reinsert breakpoints. */
67
68 void delete_reinsert_breakpoints (void);
69
70 /* Reinsert breakpoints at WHERE (and change their status to
71 inserted). */
72
73 void reinsert_breakpoints_at (CORE_ADDR where);
74
75 /* Uninsert breakpoints at WHERE (and change their status to
76 uninserted). This still leaves the breakpoints in the table. */
77
78 void uninsert_breakpoints_at (CORE_ADDR where);
79
80 /* See if any breakpoint claims ownership of STOP_PC. Call the handler for
81 the breakpoint, if found. */
82
83 void check_breakpoints (CORE_ADDR stop_pc);
84
85 /* See if any breakpoints shadow the target memory area from MEM_ADDR
86 to MEM_ADDR + MEM_LEN. Update the data already read from the target
87 (in BUF) if necessary. */
88
89 void check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len);
90
91 /* See if any breakpoints shadow the target memory area from MEM_ADDR
92 to MEM_ADDR + MEM_LEN. Update the data to be written to the target
93 (in BUF) if necessary, as well as the original data for any breakpoints. */
94
95 void check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len);
96
97 /* Set the byte pattern to insert for memory breakpoints. This function
98 must be called before any breakpoints are set. */
99
100 void set_breakpoint_data (const unsigned char *bp_data, int bp_len);
101
102 /* Delete all breakpoints. */
103
104 void delete_all_breakpoints (void);
105
106 /* Clear the "inserted" flag in all breakpoints of PROC. */
107
108 void mark_breakpoints_out (struct process_info *proc);
109
110 /* Delete all breakpoints, but do not try to un-insert them from the
111 inferior. */
112
113 void free_all_breakpoints (struct process_info *proc);
114
115 /* Check if breakpoints still seem to be inserted in the inferior. */
116
117 void validate_breakpoints (void);
118
119 #endif /* MEM_BREAK_H */
This page took 0.061115 seconds and 5 git commands to generate.