The usage string directly printed by print_debugger_command() and
invoke_debugger_command() is now automatically preceded by "usage: <command name>", so the string passed to add_debugger_command_etc() shouldn't contain it anymore. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23584 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -879,29 +879,29 @@ status_t
|
|||||||
debug_init_post_vm(kernel_args *args)
|
debug_init_post_vm(kernel_args *args)
|
||||||
{
|
{
|
||||||
add_debugger_command_etc("help", &cmd_help, "List all debugger commands",
|
add_debugger_command_etc("help", &cmd_help, "List all debugger commands",
|
||||||
"usage: %s [name]\n"
|
"[name]\n"
|
||||||
"Lists all debugger commands or those starting with \"name\".\n", 0);
|
"Lists all debugger commands or those starting with \"name\".\n", 0);
|
||||||
add_debugger_command_etc("reboot", &cmd_reboot, "Reboot the system",
|
add_debugger_command_etc("reboot", &cmd_reboot, "Reboot the system",
|
||||||
"usage: %s\n"
|
"\n"
|
||||||
"Reboots the system.\n", 0);
|
"Reboots the system.\n", 0);
|
||||||
add_debugger_command_etc("shutdown", &cmd_shutdown, "Shut down the system",
|
add_debugger_command_etc("shutdown", &cmd_shutdown, "Shut down the system",
|
||||||
"usage: %s\n"
|
"\n"
|
||||||
"Shuts down the system.\n", 0);
|
"Shuts down the system.\n", 0);
|
||||||
add_debugger_command_etc("gdb", &cmd_gdb, "Connect to remote gdb",
|
add_debugger_command_etc("gdb", &cmd_gdb, "Connect to remote gdb",
|
||||||
"usage: %s\n"
|
"\n"
|
||||||
"Connects to a remote gdb connected to the serial port.\n", 0);
|
"Connects to a remote gdb connected to the serial port.\n", 0);
|
||||||
add_debugger_command_etc("continue", &cmd_continue, "Leave kernel debugger",
|
add_debugger_command_etc("continue", &cmd_continue, "Leave kernel debugger",
|
||||||
"usage: %s\n"
|
"\n"
|
||||||
"Leaves kernel debugger.\n", 0);
|
"Leaves kernel debugger.\n", 0);
|
||||||
add_debugger_command_alias("exit", "continue", "Same as \"continue\"");
|
add_debugger_command_alias("exit", "continue", "Same as \"continue\"");
|
||||||
add_debugger_command_alias("es", "continue", "Same as \"continue\"");
|
add_debugger_command_alias("es", "continue", "Same as \"continue\"");
|
||||||
add_debugger_command_etc("message", &cmd_dump_kdl_message,
|
add_debugger_command_etc("message", &cmd_dump_kdl_message,
|
||||||
"Reprint the message printed when entering KDL",
|
"Reprint the message printed when entering KDL",
|
||||||
"usage: %s\n"
|
"\n"
|
||||||
"Reprints the message printed when entering KDL.\n", 0);
|
"Reprints the message printed when entering KDL.\n", 0);
|
||||||
add_debugger_command_etc("expr", &cmd_expr,
|
add_debugger_command_etc("expr", &cmd_expr,
|
||||||
"Evaluates the given expression and prints the result",
|
"Evaluates the given expression and prints the result",
|
||||||
"usage: %s <expression>\n"
|
"<expression>\n"
|
||||||
"Evaluates the given expression and prints the result.\n", 0);
|
"Evaluates the given expression and prints the result.\n", 0);
|
||||||
|
|
||||||
debug_variables_init();
|
debug_variables_init();
|
||||||
|
|||||||
@@ -99,7 +99,8 @@ invoke_debugger_command(struct debugger_command *command, int argc, char** argv)
|
|||||||
// If we know the command's usage text, intercept "--help" invocations
|
// If we know the command's usage text, intercept "--help" invocations
|
||||||
// and print it directly.
|
// and print it directly.
|
||||||
if (argc == 2 && strcmp(argv[1], "--help") == 0 && command->usage != NULL) {
|
if (argc == 2 && strcmp(argv[1], "--help") == 0 && command->usage != NULL) {
|
||||||
kprintf(command->usage, command->name);
|
kprintf("usage: %s ", command->name);
|
||||||
|
kprintf(command->usage);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,7 +234,8 @@ print_debugger_command_usage(const char* commandName)
|
|||||||
// directly print the usage text, if we know it, otherwise invoke the
|
// directly print the usage text, if we know it, otherwise invoke the
|
||||||
// command with "--help"
|
// command with "--help"
|
||||||
if (command->usage != NULL) {
|
if (command->usage != NULL) {
|
||||||
kprintf(command->usage, command->name);
|
kprintf("usage: %s ", command->name);
|
||||||
|
kprintf(command->usage);
|
||||||
} else {
|
} else {
|
||||||
char* args[3] = { NULL, "--help", NULL };
|
char* args[3] = { NULL, "--help", NULL };
|
||||||
invoke_debugger_command(command, 2, args);
|
invoke_debugger_command(command, 2, args);
|
||||||
|
|||||||
Reference in New Issue
Block a user