diff --git a/share/man/man9/panic.9 b/share/man/man9/panic.9 index b2dc5a070874..c782c1c187cb 100644 --- a/share/man/man9/panic.9 +++ b/share/man/man9/panic.9 @@ -1,4 +1,4 @@ -.\" $NetBSD: panic.9,v 1.7 1999/03/06 22:09:29 mycroft Exp $ +.\" $NetBSD: panic.9,v 1.8 2000/05/26 20:25:57 jhawk Exp $ .\" .\" Copyright (c) 1996 Michael Graff. .\" All rights reserved. @@ -29,7 +29,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 11, 1995 +.Dd May 26, 2000 .Dt PANIC 9 .Os .Sh NAME @@ -53,11 +53,25 @@ is a style format string which is printed to the console and saved in the variable .Va panicstr -for later retrival via core dump inspection. +for later retrieval via core dump inspection. .Pp If a kernel debugger is installed, control is passed to it after the -message is printed. -Otherwise an attempt is made to save an image of system memory on the +message is printed. If the kernel debugger is +.Xr ddb 4 , +control is only passed if the value of the +.Em ddb.onpanic +.Xr sysctl 3 +is +.Dq 1 , +otherwise, a +.Xr ddb 4 -specific +function is used to print the kernel stack trace, and then control returns +to +.Fn panic . +.Pp +If control remains in +.Fn panic , +an attempt is made to save an image of system memory on the dump device that was configured at the time the kernel was compiled. .Pp If during the process of handling the panic, @@ -70,5 +84,9 @@ The .Fn panic function does not return. .Sh SEE ALSO +.Xr sysctl 3 , +.Xr ddb 4 , +.Xr ipkdb 4 , .Xr options 4 , -.Xr savecore 8 +.Xr savecore 8 , +.Xr sysctl 8 diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 1ddceca407f8..0f9e7ac7c391 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr_prf.c,v 1.71 2000/05/25 21:32:41 jhawk Exp $ */ +/* $NetBSD: subr_prf.c,v 1.72 2000/05/26 20:25:57 jhawk Exp $ */ /*- * Copyright (c) 1986, 1988, 1991, 1993 @@ -63,6 +63,9 @@ #ifdef DDB #include +#include +#include +#include #endif #ifdef IPKDB @@ -214,6 +217,12 @@ panic(fmt, va_alist) #ifdef DDB if (db_onpanic) Debugger(); + else { + printf("Begin traceback...\n"); + db_stack_trace_print((db_expr_t)__builtin_frame_address(0), + TRUE, 65535, "", printf); + printf("End traceback...\n"); + } #endif cpu_reboot(bootopt, NULL); }