From 924dfd98012aad8409ee292924279d64be49a719 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sat, 23 Mar 1996 11:31:16 +0000 Subject: [PATCH] Remove all traces of KADB add sysctl debug.debugger_on_panic: 1 if DDB or KGDB is defined. Requested by: davidg --- sys/kern/subr_prf.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index d1d396a3248c..eb4335679924 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)subr_prf.c 8.3 (Berkeley) 1/21/94 - * $Id: subr_prf.c,v 1.29 1996/01/29 03:18:05 gibbs Exp $ + * $Id: subr_prf.c,v 1.30 1996/02/28 21:42:15 gpalmer Exp $ */ #include "opt_ddb.h" @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include /* @@ -59,10 +61,16 @@ */ #include -#ifdef KADB -#include +#if defined(DDB) || defined (KGDB) +#ifdef DDB_UNATTENDED + static int debugger_on_panic = 0; +#else + static int debugger_on_panic = 1; #endif +SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW, + &debugger_on_panic, 0, ""); +#endif #define TOCONS 0x01 #define TOTTY 0x02 @@ -112,18 +120,14 @@ panic(const char *fmt, ...) va_end(ap); printf("\n"); + if (debugger_on_panic) { #ifdef KGDB - kgdb_panic(); -#endif -#ifdef KADB - if (boothowto & RB_KDB) - kdbpanic(); + kgdb_panic(); #endif #ifdef DDB -#ifndef DDB_UNATTENDED - Debugger ("panic"); -#endif + Debugger ("panic"); #endif + } boot(bootopt); }