Module Name: src Committed By: christos Date: Fri Jun 26 14:26:38 UTC 2015
Modified Files: src/sys/kern: kgdb_stub.c Log Message: Wait for the next character forever as kgdb wants. To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/kern/kgdb_stub.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kgdb_stub.c diff -u src/sys/kern/kgdb_stub.c:1.28 src/sys/kern/kgdb_stub.c:1.29 --- src/sys/kern/kgdb_stub.c:1.28 Sun Sep 21 13:17:15 2014 +++ src/sys/kern/kgdb_stub.c Fri Jun 26 10:26:38 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: kgdb_stub.c,v 1.28 2014/09/21 17:17:15 christos Exp $ */ +/* $NetBSD: kgdb_stub.c,v 1.29 2015/06/26 14:26:38 christos Exp $ */ /* * Copyright (c) 1990, 1993 @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.28 2014/09/21 17:17:15 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.29 2015/06/26 14:26:38 christos Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -85,8 +85,17 @@ static void *kgdb_ioarg; static u_char buffer[KGDB_BUFLEN]; static kgdb_reg_t gdb_regs[KGDB_NUMREGS]; -#define GETC() ((*kgdb_getc)(kgdb_ioarg)) -#define PUTC(c) ((*kgdb_putc)(kgdb_ioarg, c)) +#define GETC() kgdb_waitc(kgdb_ioarg) +#define PUTC(c) (*kgdb_putc)(kgdb_ioarg, c) + +static int +kgdb_waitc(void *arg) +{ + int c; + while ((c = (*kgdb_getc)(arg)) == -1) + continue; + return c; +} /* * db_trap_callback can be hooked by MD port code to handle special