OSDN Git Service

Copyright updates for 2007.
[pf3gnuchains/pf3gnuchains3x.git] / gdb / gdbserver / mem-break.h
1 /* Memory breakpoint interfaces for the remote server for GDB.
2    Copyright (C) 2002, 2005, 2007 Free Software Foundation, Inc.
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
10    the Free Software Foundation; either version 2 of the License, or
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
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor,
21    Boston, MA 02110-1301, USA.  */
22
23 #ifndef MEM_BREAK_H
24 #define MEM_BREAK_H
25
26 /* Breakpoints are opaque.  */
27
28 /* Create a new breakpoint at WHERE, and call HANDLER when
29    it is hit.  */
30
31 void set_breakpoint_at (CORE_ADDR where,
32                         void (*handler) (CORE_ADDR));
33
34 /* Create a reinsertion breakpoint at STOP_AT for the breakpoint
35    currently at STOP_PC (and temporarily remove the breakpoint at
36    STOP_PC).  */
37
38 void reinsert_breakpoint_by_bp (CORE_ADDR stop_pc, CORE_ADDR stop_at);
39
40 /* Change the status of the breakpoint at WHERE to inserted.  */
41
42 void reinsert_breakpoint (CORE_ADDR where);
43
44 /* Change the status of the breakpoint at WHERE to uninserted.  */
45
46 void uninsert_breakpoint (CORE_ADDR where);
47
48 /* See if any breakpoint claims ownership of STOP_PC.  Call the handler for
49    the breakpoint, if found.  */
50
51 int check_breakpoints (CORE_ADDR stop_pc);
52
53 /* See if any breakpoints shadow the target memory area from MEM_ADDR
54    to MEM_ADDR + MEM_LEN.  Update the data already read from the target
55    (in BUF) if necessary.  */
56
57 void check_mem_read (CORE_ADDR mem_addr, unsigned char *buf, int mem_len);
58
59 /* See if any breakpoints shadow the target memory area from MEM_ADDR
60    to MEM_ADDR + MEM_LEN.  Update the data to be written to the target
61    (in BUF) if necessary, as well as the original data for any breakpoints.  */
62
63 void check_mem_write (CORE_ADDR mem_addr, unsigned char *buf, int mem_len);
64
65 /* Set the byte pattern to insert for memory breakpoints.  This function
66    must be called before any breakpoints are set.  */
67
68 void set_breakpoint_data (const unsigned char *bp_data, int bp_len);
69
70 #endif /* MEM_BREAK_H */