Subject: Re: ddb_onpanic [Re: CVS commit: src/sys/kern]
To: Darren Reed <darrenr@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 01/28/2006 14:57:06
On Sat, Jan 28, 2006 at 01:51:35PM +0000, Darren Reed wrote:
> 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.

OK, so I completely misunderstood what your change was about. Sorry for that.
From your message log I though you added the db_stack_trace_print() call.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--