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
18
19struct LR35902DebugBreakpoint {
20 uint16_t address;
21 int segment;
22};
23
24struct LR35902DebugWatchpoint {
25 uint16_t address;
26 int segment;
27 enum mWatchpointType type;
28};
29
30struct LR35902Segment {
31 uint16_t start;
32 uint16_t end;
33 const char* name;
34};
35
36DECLARE_VECTOR(LR35902DebugBreakpointList, struct LR35902DebugBreakpoint);
37DECLARE_VECTOR(LR35902DebugWatchpointList, struct LR35902DebugWatchpoint);
38
39struct LR35902Debugger {
40 struct mDebuggerPlatform d;
41 struct LR35902Core* cpu;
42
43 struct LR35902DebugBreakpointList breakpoints;
44 struct LR35902DebugWatchpointList watchpoints;
45 struct LR35902Memory originalMemory;
46
47 const struct LR35902Segment* segments;
48};
49
50struct mDebuggerPlatform* LR35902DebuggerPlatformCreate(void);
51
52CXX_GUARD_END
53
54#endif