summaryrefslogtreecommitdiff
path: root/kern/gdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/gdb.c')
-rw-r--r--kern/gdb.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/kern/gdb.c b/kern/gdb.c
new file mode 100644
index 00000000..250bf8d8
--- /dev/null
+++ b/kern/gdb.c
@@ -0,0 +1,37 @@
+/*
+ * Mach Kernel - GDB Stub Code
+ * Copyright (c) 2007 Free Software Foundation
+ */
+
+#include <mach/std_types.h>
+#include <sys/types.h>
+
+/**
+ * We don't have a header file for the com
+ * functions, so extern them here, and talk
+ * about on bug-hurd about making the header
+ */
+
+extern int comcnputc(dev_t dev, int c);
+extern int comcngetc(dev_t dev, int wait);
+
+/**
+ * putDebugChar puts a character over the serial port
+ * for the GDB stub. Its prototyped in stub-i386.c
+ */
+
+void putDebugChar(int character)
+{
+ comcnputc(0, character);
+}
+
+/**
+ * getDebugChar gets a character over the serial port
+ * for the GDB stub. Its prototyped in stub-i386.c.
+ * It uses
+ */
+
+int getDebugChar()
+{
+ return comcngetc(0, 10);
+}