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};
30
31struct LR35902Segment {
32 uint16_t start;
33 uint16_t end;
34 const char* name;
35};
36
37DECLARE_VECTOR(LR35902DebugBreakpointList, struct LR35902DebugBreakpoint);
38DECLARE_VECTOR(LR35902DebugWatchpointList, struct LR35902DebugWatchpoint);
39
40struct LR35902Debugger {
41 struct mDebuggerPlatform d;
42 struct LR35902Core* cpu;
43
44 struct LR35902DebugBreakpointList breakpoints;
45 struct LR35902DebugWatchpointList watchpoints;
46 struct LR35902Memory originalMemory;
47
48 const struct LR35902Segment* segments;
49};
50
51struct mDebuggerPlatform* LR35902DebuggerPlatformCreate(void);
52
53CXX_GUARD_END
54
55#endif