From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261337AbUKBQWP (ORCPT ); Tue, 2 Nov 2004 11:22:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262125AbUKBQPa (ORCPT ); Tue, 2 Nov 2004 11:15:30 -0500 Received: from mx1.redhat.com ([66.187.233.31]:7649 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S262250AbUKBQKN (ORCPT ); Tue, 2 Nov 2004 11:10:13 -0500 From: David Howells In-Reply-To: <20041102093440.GA5841@infradead.org> References: <20041102093440.GA5841@infradead.org> <76b4a884-2c3c-11d9-91a1-0002b3163499@redhat.com> <200411011930.iA1JULar023202@warthog.cambridge.redhat.com> To: Christoph Hellwig Cc: torvalds@osdl.org, akpm@osdl.org, davidm@snapgear.com, linux-kernel@vger.kernel.org, uclinux-dev@uclinux.org Subject: Re: [PATCH 7/14] FRV: GDB stub dependent additional BUG()'s User-Agent: EMH/1.14.1 SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Date: Tue, 02 Nov 2004 16:09:58 +0000 Message-ID: <25541.1099411798@redhat.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > please avoid the ifdef mess and add some invoke_debugger or whatever macro > burried in some header. Having an invoke_debugger() function is not a bad idea; perhaps something like this would do: vsnprintf(buf, sizeof(buf), fmt, args); va_end(args); printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf); + invoke_debugger(SIGKILL); bust_spinlocks(0); #ifdef CONFIG_SMP What's the best way to add an invoke_debugger() function without having to change every arch? #ifdef/#endif in kernel/panic.c maybe... > besides the ifdef mess this changes behaviour as it didn't BUG without, > please skip this hunk completely. Why? If you've got a debugger attached, it'd seem reasonable to want it to jump into the debugger in these circumstances; after all, your system is probably stuffed after this point. Perhaps I should make it do: page->mapping, page_mapcount(page), page_count(page)); printk(KERN_EMERG "Backtrace:\n"); dump_stack(); + invoke_debugger(SIGABRT); Which the arch can then use or ignore as it wills; and the if the arch passes it on to the debugger, the debugger can use or ignore as it wills. David