src/debugger/gdb-stub.h (view raw)
1#ifndef GDB_STUB_H
2#define GDB_STUB_H
3
4#include "common.h"
5
6#include "debugger/debugger.h"
7
8#include "util/socket.h"
9
10#define GDB_STUB_MAX_LINE 1200
11
12enum GDBStubAckState {
13 GDB_ACK_PENDING = 0,
14 GDB_ACK_RECEIVED,
15 GDB_NAK_RECEIVED,
16 GDB_ACK_OFF
17};
18
19struct GDBStub {
20 struct ARMDebugger d;
21
22 char line[GDB_STUB_MAX_LINE];
23 char outgoing[GDB_STUB_MAX_LINE];
24 enum GDBStubAckState lineAck;
25
26 Socket socket;
27 Socket connection;
28};
29
30void GDBStubCreate(struct GDBStub*);
31int GDBStubListen(struct GDBStub*, int port, uint32_t bindAddress);
32
33void GDBStubHangup(struct GDBStub*);
34void GDBStubShutdown(struct GDBStub*);
35
36void GDBStubUpdate(struct GDBStub*);
37
38#endif