summaryrefslogtreecommitdiff
path: root/kern/gdb.c
blob: 44658bd245978afeab3cdecdf834c9beb3f38c43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * 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.
 */

int getDebugChar()
{
  return comcngetc(0, TRUE);
}