lkml.org 
[lkml]   [2004]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 7/14] FRV: GDB stub dependent additional BUG()'s
Date

> 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.079 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site