On Thursday 04 Mar 2004 10:48 am, Andrew Morton wrote:
"Amit S. Kale" <amitkale@xxxxxxxxxxxxx> wrote:
Flashing keyboard lights is easy on x86 and x86_64 platforms.
Please, no keyboards. Some people want to be able to use kgdboe
to find out why machine number 324 down the corridor just died.
How about just doing
char *why_i_crashed;
{
...
if (expr1)
why_i_crashed = "hit a BUG";
else if (expr2)
why_i_crashed = "divide by zero";
else ...
}
then provide a gdb macro which prints out the string at *why_i_crashed?
If we can afford to do this (in terms of actions that can be done with the machine being unstable) we can certainly print a console message through gdb.
A stub is free to send console messages to gdb at any time. We can send a "'O'hex(Page fault at 0x1234)" packet to gdb regardless of whether CONFIG_KGDB_CONSOLE is configured in. This way kgdb will send this packet to gdb and then immediately report a segfault/trap. To a user it'll appear as a message printed from gdb "Page fault at 0x1234" followed by gdb showing a SIGSEGV etc. The gdb console message should print information other than a signal number.
-Amit