Added "error" debugger command to print the error string for a given

numeric error code.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23978 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-02-17 14:36:03 +00:00
parent b19e377dab
commit d63cbbe2df

View File

@ -687,6 +687,21 @@ cmd_expr(int argc, char **argv)
}
static int
cmd_error(int argc, char **argv)
{
if (argc != 2) {
print_debugger_command_usage(argv[0]);
return 0;
}
int32 error = parse_expression(argv[1]);
kprintf("error 0x%lx: %s\n", error, strerror(error));
return 0;
}
static status_t
syslog_sender(void *data)
{
@ -964,6 +979,12 @@ debug_init_post_vm(kernel_args *args)
"<expression>\n"
"Evaluates the given expression and prints the result.\n",
B_KDEBUG_DONT_PARSE_ARGUMENTS);
add_debugger_command_etc("error", &cmd_error,
"Prints a human-readable description for an error code",
"<error>\n"
"Prints a human-readable description for the given numeric error\n"
"code.\n"
" <error> - The numeric error code.\n", 0);
debug_variables_init();
frame_buffer_console_init(args);