2c672c3ad6a867b9ff1c5488ecfda94adeef127a
[simavr] / simavr / sim / sim_gdb.h
1 /*
2         sim_gdb.h
3
4         Copyright 2008, 2009 Michel Pollet <buserror@gmail.com>
5
6         This file is part of simavr.
7
8         simavr 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 3 of the License, or
11         (at your option) any later version.
12
13         simavr 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 simavr.  If not, see <http://www.gnu.org/licenses/>.
20  */
21
22 #ifndef __SIM_GDB_H__
23 #define __SIM_GDB_H__
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 /* Watchpoint types.
30    See GDB User Manual, Appendix E.2 */
31 enum avr_gdb_watch_type {
32         AVR_GDB_BREAK_SOFT   = 1 << 0,
33         AVR_GDB_BREAK_HARD   = 1 << 1,
34
35         AVR_GDB_WATCH_WRITE  = 1 << 2,
36         AVR_GDB_WATCH_READ   = 1 << 3,
37         AVR_GDB_WATCH_ACCESS = AVR_GDB_WATCH_WRITE | AVR_GDB_WATCH_READ,
38 };
39
40 int avr_gdb_init(avr_t * avr);
41
42 // call from the main AVR decoder thread
43 int avr_gdb_processor(avr_t * avr, int sleep);
44
45 // Called from sim_core.c
46 void avr_gdb_handle_watchpoints(avr_t * g, uint16_t addr, enum avr_gdb_watch_type type);
47
48 #ifdef __cplusplus
49 };
50 #endif
51
52 #endif