summaryrefslogtreecommitdiff
path: root/kern/gdb.c
diff options
context:
space:
mode:
authorMichael Casadevall <sonicmctails@gmail.com>2007-12-19 22:18:37 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:35:13 +0200
commit894bc8c5b7936d274195f70b6db560f4fec569f4 (patch)
treebd0181ca26850bc5660e846bbc416927f8a9cf16 /kern/gdb.c
parent45b1b09e0c92f21852d16477e722595e70bc0919 (diff)
Inital commit of gdb branch
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);
+}