Re: [PATCH 7/14] FRV: GDB stub dependent additional BUG()'s

From: Christoph Hellwig
Date: Tue Nov 02 2004 - 04:56:14 EST


On Mon, Nov 01, 2004 at 07:30:21PM +0000, dhowells@xxxxxxxxxx wrote:
> The attached patch adds a couple of extra BUG() calls if a GDB stub is
> configured in the kernel. These allow the GDB stub to catch bad_page() and
> panic().
>
> Signed-Off-By: dhowells@xxxxxxxxxx
> ---
> diffstat frv-gdbstub-2610rc1bk10.diff
> kernel/panic.c | 3 +++
> mm/page_alloc.c | 3 +++
> 2 files changed, 6 insertions(+)
>
> diff -uNr /warthog/kernels/linux-2.6.10-rc1-bk10/kernel/panic.c linux-2.6.10-rc1-bk10-frv/kernel/panic.c
> --- /warthog/kernels/linux-2.6.10-rc1-bk10/kernel/panic.c 2004-10-27 17:32:38.000000000 +0100
> +++ linux-2.6.10-rc1-bk10-frv/kernel/panic.c 2004-11-01 11:47:05.162632657 +0000
> @@ -59,6 +59,9 @@
> vsnprintf(buf, sizeof(buf), fmt, args);
> va_end(args);
> printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf);
> +#ifdef CONFIG_GDBSTUB
> + BUG();
> +#endif
> bust_spinlocks(0);
>
> #ifdef CONFIG_SMP

please avoid the ifdef mess and add some invoke_debugger or whatever macro
burried in some header.

> diff -uNr /warthog/kernels/linux-2.6.10-rc1-bk10/mm/page_alloc.c linux-2.6.10-rc1-bk10-frv/mm/page_alloc.c
> --- /warthog/kernels/linux-2.6.10-rc1-bk10/mm/page_alloc.c 2004-11-01 11:45:35.000000000 +0000
> +++ linux-2.6.10-rc1-bk10-frv/mm/page_alloc.c 2004-11-01 11:47:05.230626996 +0000
> @@ -83,6 +83,9 @@
> page->mapping, page_mapcount(page), page_count(page));
> printk(KERN_EMERG "Backtrace:\n");
> dump_stack();
> +#ifdef CONFIG_GDBSTUB
> + BUG();
> +#endif

besides the ifdef mess this changes behaviour as it didn't BUG without,
please skip this hunk completely.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/