From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 18 20:30:06 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BDDF1065679; Sat, 18 Sep 2010 20:30:06 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 956078FC18; Sat, 18 Sep 2010 20:30:05 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA11471; Sat, 18 Sep 2010 23:30:03 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Ox42t-000DZ7-8B; Sat, 18 Sep 2010 23:30:03 +0300 Message-ID: <4C95214A.3070600@freebsd.org> Date: Sat, 18 Sep 2010 23:30:02 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100912 Lightning/1.0b2 Thunderbird/3.1.3 MIME-Version: 1.0 To: Attilio Rao References: <4C94A138.8050905@icyb.net.ua> <4C9507D1.3010008@icyb.net.ua> <4C950C48.6020600@freebsd.org> In-Reply-To: <4C950C48.6020600@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: KDB_TRACE and no backend X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 20:30:06 -0000 on 18/09/2010 22:00 Andriy Gapon said the following: > Oh, wow, and I totally overlooked stack_print(). > Should have read stack(9) from the start. New patch. Hope this is better. I don't like that the printf is duplicated, but couldn't figure out a way to combine pre-processor and C conditions. --- a/sys/kern/subr_kdb.c +++ b/sys/kern/subr_kdb.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -300,6 +301,15 @@ kdb_backtrace(void) printf("KDB: stack backtrace:\n"); kdb_dbbe->dbbe_trace(); } +#ifdef STACK + else { + struct stack st; + + printf("KDB: stack backtrace:\n"); + stack_save(&st); + stack_print(&st); + } +#endif } /* -- Andriy Gapon