include/mgba/internal/lr35902/debugger/debugger.h (view raw)
1/* Copyright (c) 2013-2016 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef LR35902_DEBUGGER_H
7#define LR35902_DEBUGGER_H
8
9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba/debugger/debugger.h>
14
15#include <mgba/internal/lr35902/lr35902.h>
16#include <mgba-util/vector.h>
17
18struct ParseTree;
19struct LR35902DebugBreakpoint {
20 uint16_t address;
21 int segment;
22 struct ParseTree* condition;
23};
24
25struct LR35902DebugWatchpoint {
26 uint16_t address;
27 int segment;
28 enum mWatchpointType type;
29 struct ParseTree* condition;
30};
31
32struct LR35902Segment {
33 uint16_t start;
34 uint16_t end;
35 const char* name;
36};
37
38DECLARE_VECTOR(LR35902DebugBreakpointList, struct LR35902DebugBreakpoint);
39DECLARE_VECTOR(LR35902DebugWatchpointList, struct LR35902DebugWatchpoint);
40
41struct LR35902Debugger {
42 struct mDebuggerPlatform d;
43 struct LR35902Core* cpu;
44
45 struct LR35902DebugBreakpointList breakpoints;
46 struct LR35902DebugWatchpointList watchpoints;
47 struct LR35902Memory originalMemory;
48
49 const struct LR35902Segment* segments;
50};
51
52struct mDebuggerPlatform* LR35902DebuggerPlatformCreate(void);
53
54CXX_GUARD_END
55
56#endif