Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Sep 2002 16:40:55 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        David Malone <dwmalone@maths.tcd.ie>
Cc:        cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, obrien@FreeBSD.org, joe@FreeBSD.org, bde@zeta.org.au, "M. Warner Losh" <imp@bsdimp.com>, Mike Silbersack <silby@silby.com>, Julian Elischer <julian@elischer.org>, Alfred Perlstein <bright@mu.org>, Poul-Henning Kamp <phk@critter.freebsd.dk>
Subject:   Re: cvs commit: src/sys/kern kern_timeout.c
Message-ID:  <XFMail.20020919164055.jhb@FreeBSD.org>
In-Reply-To: <20020919150623.GA36764@lanczos.maths.tcd.ie>

next in thread | previous in thread | raw e-mail | index | archive | help

On 19-Sep-2002 David Malone wrote:
> On Wed, Sep 18, 2002 at 10:06:47PM +0200, Poul-Henning Kamp wrote:
>> >I'm for this as well.  (panic -> stacktrace)
>> 
>> I havn't heard anybody be against it, but I have also not heard
>> anybody say "I'll do it" yet.
>> 
>> It's on my JKH-TODO page btw, and I don't think we need one of
>> our already busy senior developers to do this, it's a perfect
>> example of a beginners task...
> 
> I think it requires someone with a knowlege of the stack structure
> on each of our ARCHs 'cos the current back trace function needs to
> be given some sort of frame pointer. I got that far before I got
> distracted.

Well, sort of.  If you don't give it an address, it uses the one
for the current thread.  However, it usually tries to grab the one
from ddb regs I think.  However, you can try just using this to
see if it works:

        db_stack_trace_cmd(0, 0, -1, NULL);

Well, that really isn't going to work unless ddb_regs is set to
something useful. :-/  I think instead a much better idea would
be to have kdb_trap() do an automatic backtrace if it is invoked
from a panic.  Then change how DDB_UNATTENDED works a bit so that
instead of skipping Debugger() altogether it instead returns
from Debugger() after doing any automatic stack trace w/o doing
any additional work.  Hmm, that actually is somewhat of a pain.
Having a MD print_stacktrace() that calls db_stack_trace_cmd()
might not be all that hard though.

Hmm, untested patch is at
http://www.FreeBSD.org/~jhb/patches/backtrace.patch  It has
stubs for ia64, ppc, and sparc64, but has possibly working
code for i386 and alpha.  Note that you need a good portion
of ddb around to make this work (all the printf stuff and symbol
table stuff).

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20020919164055.jhb>