From owner-p4-projects@FreeBSD.ORG Wed Mar 10 13:46:39 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1E72B16A4D0; Wed, 10 Mar 2004 13:46:39 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EBE2E16A4CE for ; Wed, 10 Mar 2004 13:46:38 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE8BF43D31 for ; Wed, 10 Mar 2004 13:46:38 -0800 (PST) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i2ALkcGe083080 for ; Wed, 10 Mar 2004 13:46:38 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i2ALkcCV083077 for perforce@freebsd.org; Wed, 10 Mar 2004 13:46:38 -0800 (PST) (envelope-from marcel@freebsd.org) Date: Wed, 10 Mar 2004 13:46:38 -0800 (PST) Message-Id: <200403102146.i2ALkcCV083077@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 48623 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2004 21:46:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=48623 Change 48623 by marcel@marcel_nfs on 2004/03/10 13:46:37 Replace #ifdef DDB with #ifdef KDB and not with #ifdef DEBUG. Add KDB as a global option. Requested by: phk, jmallet Affected files ... .. //depot/projects/gdb/sys/alpha/tlsb/zs_tlsb.c#4 edit .. //depot/projects/gdb/sys/amd64/amd64/machdep.c#6 edit .. //depot/projects/gdb/sys/conf/NOTES#6 edit .. //depot/projects/gdb/sys/conf/options#6 edit .. //depot/projects/gdb/sys/i386/i386/machdep.c#4 edit .. //depot/projects/gdb/sys/i386/isa/pcvt/pcvt_kbd.c#3 edit .. //depot/projects/gdb/sys/ia64/ia64/machdep.c#4 edit .. //depot/projects/gdb/sys/kern/kern_clock.c#4 edit .. //depot/projects/gdb/sys/kern/kern_shutdown.c#4 edit .. //depot/projects/gdb/sys/kern/subr_witness.c#5 edit .. //depot/projects/gdb/sys/kern/vfs_vnops.c#3 edit .. //depot/projects/gdb/sys/pc98/i386/machdep.c#3 edit .. //depot/projects/gdb/sys/powerpc/powermac/pswitch.c#3 edit .. //depot/projects/gdb/sys/sparc64/sparc64/machdep.c#3 edit Differences ... ==== //depot/projects/gdb/sys/alpha/tlsb/zs_tlsb.c#4 (text+ko) ==== @@ -525,7 +525,7 @@ while (zs_get_status(base, 0) & 1) { c = zs_get_data(base, 0); -#ifdef DEBUG +#ifdef KDB if (c == CTRL('\\')) kdb_enter("manual escape to debugger"); #endif @@ -540,7 +540,7 @@ while (zs_get_status(base, 1) & 1) { c = zs_get_data(base, 1); -#ifdef DEBUG +#ifdef KDB if (c == CTRL('\\')) kdb_enter("manual escape to debugger"); #endif ==== //depot/projects/gdb/sys/amd64/amd64/machdep.c#6 (text+ko) ==== @@ -1216,7 +1216,7 @@ kdb_init(); -#ifdef DEBUG +#ifdef KDB if (boothowto & RB_KDB) kdb_enter("Boot flags requested debugger"); #endif ==== //depot/projects/gdb/sys/conf/NOTES#6 (text+ko) ==== @@ -229,6 +229,11 @@ # DEBUGGING OPTIONS # +# Compile with kernel debugger related code. +# +options KDB + +# # Print a stack trace of the current thread on the console for a panic. # options KDB_TRACE ==== //depot/projects/gdb/sys/conf/options#6 (text+ko) ==== @@ -77,6 +77,7 @@ DDB_NUMSYM opt_ddb.h GDB GDBSPEED opt_gdb.h +KDB opt_global.h KDB_TRACE opt_kdb.h KDB_UNATTENDED opt_kdb.h ==== //depot/projects/gdb/sys/i386/i386/machdep.c#4 (text+ko) ==== @@ -2101,7 +2101,7 @@ kdb_init(); -#ifdef DEBUG +#ifdef KDB if (boothowto & RB_KDB) kdb_enter("Boot flags requested debugger"); #endif ==== //depot/projects/gdb/sys/i386/isa/pcvt/pcvt_kbd.c#3 (text+ko) ==== @@ -945,7 +945,7 @@ shutdown_nice(0); #endif /* PCVT_CTRL_ALT_DEL */ -#if defined(DEBUG) /* Check for cntl-alt-esc */ +#if defined(KDB) /* Check for cntl-alt-esc */ if((key == 110) && ctrl_down && (meta_down || altgr_down)) { @@ -958,7 +958,7 @@ goto loop; } } -#endif /* defined(DEBUG) */ +#endif /* defined(KDB) */ /* look for keys with special handling */ if(key == 128) ==== //depot/projects/gdb/sys/ia64/ia64/machdep.c#4 (text+ko) ==== @@ -755,7 +755,7 @@ */ kdb_init(); -#ifdef DEBUG +#ifdef KDB if (boothowto & RB_KDB) kdb_enter("Boot flags requested debugger\n"); #endif ==== //depot/projects/gdb/sys/kern/kern_clock.c#4 (text+ko) ==== @@ -548,12 +548,12 @@ } printf("Total %20ju\n", (uintmax_t)inttotal); -#ifdef DEBUG +#ifdef KDB kdb_backtrace(); kdb_enter("watchdog timeout"); #else panic("watchdog timeout"); -#endif /* DEBUG */ +#endif /* KDB */ } #endif /* SW_WATCHDOG */ ==== //depot/projects/gdb/sys/kern/kern_shutdown.c#4 (text+ko) ==== @@ -84,7 +84,7 @@ */ #include -#ifdef DEBUG +#ifdef KDB #ifdef KDB_UNATTENDED int debugger_on_panic = 0; #else @@ -100,7 +100,7 @@ #endif SYSCTL_INT(_debug, OID_AUTO, trace_on_panic, CTLFLAG_RW, &trace_on_panic, 0, "Print stack trace on kernel panic"); -#endif /* DEBUG */ +#endif /* KDB */ int sync_on_panic = 1; SYSCTL_INT(_kern, OID_AUTO, sync_on_panic, CTLFLAG_RW, @@ -507,7 +507,7 @@ #endif #endif -#ifdef DEBUG +#ifdef KDB if (newpanic && trace_on_panic) kdb_backtrace(); if (debugger_on_panic) ==== //depot/projects/gdb/sys/kern/subr_witness.c#5 (text+ko) ==== @@ -207,10 +207,10 @@ SYSCTL_PROC(_debug, OID_AUTO, witness_watch, CTLFLAG_RW | CTLTYPE_INT, NULL, 0, sysctl_debug_witness_watch, "I", "witness is watching lock operations"); -#ifdef DEBUG +#ifdef KDB /* - * When DEBUG is enabled and witness_kdb is set to 1, it will cause the - * system to drop into kdebug() when: + * When KDB is enabled and witness_kdb is set to 1, it will cause the system + * to drop into kdebug() when: * - a lock heirarchy violation occurs * - locks are held when going to sleep. */ @@ -223,15 +223,15 @@ SYSCTL_INT(_debug, OID_AUTO, witness_kdb, CTLFLAG_RW, &witness_kdb, 0, ""); /* - * When DEBUG is enabled and witness_trace is set to 1, it will cause the - * system to print a stack trace: + * When KDB is enabled and witness_trace is set to 1, it will cause the system + * to print a stack trace: * - a lock heirarchy violation occurs * - locks are held when going to sleep. */ int witness_trace = 1; TUNABLE_INT("debug.witness_trace", &witness_trace); SYSCTL_INT(_debug, OID_AUTO, witness_trace, CTLFLAG_RW, &witness_trace, 0, ""); -#endif /* DEBUG */ +#endif /* KDB */ #ifdef WITNESS_SKIPSPIN int witness_skipspin = 1; @@ -872,7 +872,7 @@ mtx_unlock_spin(&w_mtx); return; -#ifdef DEBUG +#ifdef KDB debugger: if (witness_trace) kdb_backtrace(); @@ -1148,7 +1148,7 @@ } if (flags & WARN_PANIC && n) panic("witness_warn"); -#ifdef DEBUG +#ifdef KDB else if (witness_kdb && n) kdb_enter(__func__); #endif ==== //depot/projects/gdb/sys/kern/vfs_vnops.c#3 (text+ko) ==== @@ -790,7 +790,7 @@ } error = VOP_IOCTL(vp, com, data, fp->f_flag, active_cred, td); if (error == ENOIOCTL) { -#ifdef DEBUG +#ifdef DIAGNOSTIC kdb_enter("ENOIOCTL leaked through"); #endif error = ENOTTY; ==== //depot/projects/gdb/sys/pc98/i386/machdep.c#3 (text+ko) ==== @@ -2166,7 +2166,7 @@ kdb_init(); -#ifdef DEBUG +#ifdef KDB if (boothowto & RB_KDB) kdb_enter("Boot flags requested debugger"); #endif ==== //depot/projects/gdb/sys/powerpc/powermac/pswitch.c#3 (text+ko) ==== @@ -138,7 +138,5 @@ dev = (device_t)arg; -#ifdef DEBUG kdb_enter(device_get_nameunit(dev)); -#endif } ==== //depot/projects/gdb/sys/sparc64/sparc64/machdep.c#3 (text+ko) ==== @@ -385,7 +385,7 @@ kdb_init(); -#ifdef DEBUG +#ifdef KDB if (boothowto & RB_KDB) kdb_enter("Boot flags requested debugger"); #endif