diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2000-03-02 10:50:30 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2000-03-02 10:50:30 +0000 |
commit | 87a3a0d4b23d6e8fa73ee7e8b742aa31a20fe332 (patch) | |
tree | 545a14961beffd2c859215d82c12c60c8f3491d2 | |
parent | de505525ed3a71697af7bb50fc391c4eceac477e (diff) |
Add an option DDB_SAFE_CONSOLE that defaults db_console to 1.
In many cases, setting db_console in /etc/rc is too late.
-rw-r--r-- | share/man/man4/options.4 | 5 | ||||
-rw-r--r-- | sys/conf/GENERIC | 3 | ||||
-rw-r--r-- | sys/kern/subr_prf.c | 17 |
3 files changed, 22 insertions, 3 deletions
diff --git a/share/man/man4/options.4 b/share/man/man4/options.4 index 433be5013d4..ea47b4e3c64 100644 --- a/share/man/man4/options.4 +++ b/share/man/man4/options.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: options.4,v 1.46 2000/02/24 16:09:14 chris Exp $ +.\" $OpenBSD: options.4,v 1.47 2000/03/02 10:50:28 art Exp $ .\" $NetBSD: options.4,v 1.21 1997/06/25 03:13:00 thorpej Exp $ .\" .\" Copyright (c) 1998 Theo de Raadt @@ -159,6 +159,9 @@ Compiles in a kernel debugger for diagnosing kernel problems. See for details. .Em NOTE: not available on all architectures. +.It Cd option DDB_SAFE_CONSOLE +Allows a break into the kernel debugger during boot. Useful when +debugging problems that can cause init(8) to fail. .It Cd option KGDB Compiles in a remote kernel debugger stub for diagnosing kernel problems using the diff --git a/sys/conf/GENERIC b/sys/conf/GENERIC index 6cc6c72c7d3..ba99502ea08 100644 --- a/sys/conf/GENERIC +++ b/sys/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.61 2000/01/09 22:00:16 itojun Exp $ +# $OpenBSD: GENERIC,v 1.62 2000/03/02 10:50:29 art Exp $ # # Machine-independent option; used by all architectures for their # GENERIC kernel @@ -13,6 +13,7 @@ option SWAPPAGER # paging; REQUIRED option DEVPAGER # mmap() of devices option DDB # in-kernel debugger +#option DDB_SAFE_CONSOLE # allow break into ddb during boot #makeoptions DEBUG="-g" # compile full symbol table #makeoptions PROF="-pg" # build profiled kernel #option GPROF # kernel profiling, kgmon(8) diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 0ec990f67a9..5ab131ddc8d 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_prf.c,v 1.27 2000/02/22 19:28:04 deraadt Exp $ */ +/* $OpenBSD: subr_prf.c,v 1.28 2000/03/02 10:50:29 art Exp $ */ /* $NetBSD: subr_prf.c,v 1.45 1997/10/24 18:14:25 chuck Exp $ */ /*- @@ -109,9 +109,24 @@ extern int log_open; /* subr_log: is /dev/klog open? */ const char *panicstr; /* arg to first call to panic (used as a flag to indicate that panic has already been called). */ #ifdef DDB +/* + * Enter ddb on panic. + */ int db_panic = 1; + +/* + * db_console controls if we can be able to enter ddb by a special key + * combination (machine dependent). + * If DDB_SAFE_CONSOLE is defined in the kernel configuration it allows + * to break into console during boot. It's _really_ useful when debugging + * some things in the kernel that can cause init(8) to crash. + */ +#ifdef DDB_SAFE_CONSOLE +int db_console = 1; +#else int db_console = 0; #endif +#endif /* * v_putc: routine to putc on virtual console |