next up previous contents index
Next: 10.18.5 gdb_serial_putchar: output a Up: 10.18 Serial-line Remote Debugging Previous: 10.18.3 gdb_serial_exit: notify the

10.18.4 gdb_serial_getchar: input a character from the remote debugger's console

   

SYNOPSIS

#include <oskit/gdb_serial.h>

int gdb_serial_getchar(void);

static char inbuf[256];

DESCRIPTION

Unfortunately, the GDB protocol doesn't support console input. However, we can simulate it with a rather horrible kludge: when the kernel first does a read from the console we take a breakpoint, allowing the user to fill an input buffer with a command such as:

call strcpy(inbuf, "hello")

The supplied characters will be returned from successive calls to gdb_serial_getchar, until inbuf is emptied, at which point we hit a breakpoint again.

RETURNS

Returns the next available character in the inbuf array.

DEPENDENCIES

gdb_breakpoint
10.17.11
base_critical_enter
10.2.5
base_critical_leave
10.2.5



University of Utah Flux Research Group