2014-02-01 11:05:10 +00:00
|
|
|
#ifndef GDB_STUB_H
|
|
|
|
#define GDB_STUB_H
|
|
|
|
|
2014-04-03 06:50:20 +00:00
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
#include "debugger/debugger.h"
|
|
|
|
|
|
|
|
#include "util/socket.h"
|
2014-02-01 11:05:10 +00:00
|
|
|
|
2014-02-01 13:44:40 +00:00
|
|
|
#define GDB_STUB_MAX_LINE 1200
|
2014-02-01 11:05:10 +00:00
|
|
|
|
2014-02-01 12:10:22 +00:00
|
|
|
enum GDBStubAckState {
|
|
|
|
GDB_ACK_PENDING = 0,
|
|
|
|
GDB_ACK_RECEIVED,
|
|
|
|
GDB_NAK_RECEIVED,
|
|
|
|
GDB_ACK_OFF
|
|
|
|
};
|
|
|
|
|
2014-02-01 11:05:10 +00:00
|
|
|
struct GDBStub {
|
|
|
|
struct ARMDebugger d;
|
|
|
|
|
|
|
|
char line[GDB_STUB_MAX_LINE];
|
2014-02-01 12:10:22 +00:00
|
|
|
char outgoing[GDB_STUB_MAX_LINE];
|
|
|
|
enum GDBStubAckState lineAck;
|
2014-02-01 11:05:10 +00:00
|
|
|
|
2014-02-04 07:01:26 +00:00
|
|
|
Socket socket;
|
|
|
|
Socket connection;
|
2014-02-01 11:05:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void GDBStubCreate(struct GDBStub*);
|
|
|
|
int GDBStubListen(struct GDBStub*, int port, uint32_t bindAddress);
|
|
|
|
|
|
|
|
void GDBStubHangup(struct GDBStub*);
|
|
|
|
void GDBStubShutdown(struct GDBStub*);
|
|
|
|
|
|
|
|
void GDBStubUpdate(struct GDBStub*);
|
|
|
|
|
|
|
|
#endif
|