From owner-cvs-all Thu Sep 19 13:41: 0 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 230C037B404 for ; Thu, 19 Sep 2002 13:40:58 -0700 (PDT) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 599C343E6A for ; Thu, 19 Sep 2002 13:40:56 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 31318 invoked from network); 19 Sep 2002 20:40:58 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 19 Sep 2002 20:40:58 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.5/8.12.5) with ESMTP id g8JKerBv066584; Thu, 19 Sep 2002 16:40:54 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020919150623.GA36764@lanczos.maths.tcd.ie> Date: Thu, 19 Sep 2002 16:40:55 -0400 (EDT) From: John Baldwin To: David Malone Subject: Re: cvs commit: src/sys/kern kern_timeout.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, obrien@FreeBSD.org, joe@FreeBSD.org, bde@zeta.org.au, "M. Warner Losh" , Mike Silbersack , Julian Elischer , Alfred Perlstein , Poul-Henning Kamp Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 <>< 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