Subject: Re: ddb_onpanic [Re: CVS commit: src/sys/kern]
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Darren Reed <darrenr@NetBSD.org>
List: tech-kern
Date: 01/28/2006 13:51:35
On Sat, Jan 28, 2006 at 02:39:49PM +0100, Manuel Bouyer wrote:
> [ moved to tech-kern ]
> In panic() I see:
> if (db_onpanic == 1)
> Debugger();
> else {
> static int intrace = 0;
>
> if (intrace == 0) {
> intrace = 1;
> printf("Begin traceback...\n");
> db_stack_trace_print(
> (db_expr_t)(intptr_t)__builtin_frame_address(0),
> TRUE, 65535, "", printf);
> printf("End traceback...\n");
> intrace = 0;
> } else
> printf("Faulted in mid-traceback; aborting...");
> if (db_onpanic == 2)
> Debugger();
> }
>
>
> If db_onpanic is not 1, db_stack_trace_print() will be called, even for
> db_onpanic == 0. There's no way to avoid this.
> IMHO if we keep this the else should be changed to
> else if (db_onpanic != 0)
So far as I can tell, my change didn't add the call to db_stack_trace_print.
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_prf.c?annotate=1.101
Line 235 has been there since v1.1 of this file.
Darren