aboutsummaryrefslogtreecommitdiff
path: root/src/debug/GdbProto.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug/GdbProto.h')
-rw-r--r--src/debug/GdbProto.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/debug/GdbProto.h b/src/debug/GdbProto.h
new file mode 100644
index 0000000..ef8bdec
--- /dev/null
+++ b/src/debug/GdbProto.h
@@ -0,0 +1,40 @@
+
+#ifndef GDBPROTO_H_
+#define GDBPROTO_H_
+
+#include <string.h>
+#include <sys/types.h>
+
+#include "GdbStub.h" /* class GdbStub */
+
+
+#define MOCKTEST 0
+
+
+namespace Gdb {
+
+constexpr int GDBPROTO_BUFFER_CAPACITY = 1024+128;
+
+extern u8 Cmdbuf[GDBPROTO_BUFFER_CAPACITY];
+extern ssize_t Cmdlen;
+
+namespace Proto {
+
+extern u8 PacketBuf[GDBPROTO_BUFFER_CAPACITY];
+extern u8 RespBuf[GDBPROTO_BUFFER_CAPACITY+5];
+
+Gdb::ReadResult MsgRecv(int connfd, u8 cmd_dest[/*static GDBPROTO_BUFFER_CAPACITY*/]);
+
+int SendAck(int connfd);
+int SendNak(int connfd);
+
+int Resp(int connfd, const u8* data1, size_t len1, const u8* data2, size_t len2, bool noack);
+
+int WaitAckBlocking(int connfd, u8* ackp, int to_ms);
+
+}
+
+}
+
+#endif
+