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

From: David Howells
Date: Tue Nov 02 2004 - 11:27:45 EST



> 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
-
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/