From f3be7cb3e9c0d3621cd6b2e775aa1cbf77ec5eb6 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Mon, 12 Jul 2004 01:38:07 +0000 Subject: [PATCH] Re-add the gdb command. It was removed to be replaced by something more generic, but that didn't actually happen. Since the feature to switch backends (and historically this means from DDB to GDB) is important, make sure people can do just that until such the generic mechanism actually sees the light of day. Suggested by: rwatson@ --- sys/ddb/db_command.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 954a0d3951b..30740abc444 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -67,6 +67,7 @@ SET_DECLARE(db_cmd_set, struct command); SET_DECLARE(db_show_cmd_set, struct command); static db_cmdfcn_t db_fncall; +static db_cmdfcn_t db_gdb; static db_cmdfcn_t db_kill; static db_cmdfcn_t db_reset; static db_cmdfcn_t db_watchdog; @@ -414,6 +415,7 @@ static struct command db_command_table[] = { { "call", db_fncall, CS_OWN, 0 }, { "show", 0, 0, db_show_cmds }, { "ps", db_ps, 0, 0 }, + { "gdb", db_gdb, 0, 0 }, { "reset", db_reset, 0, 0 }, { "kill", db_kill, CS_OWN, 0 }, { "watchdog", db_watchdog, 0, 0 }, @@ -611,3 +613,13 @@ db_watchdog(dummy1, dummy2, dummy3, dummy4) EVENTHANDLER_INVOKE(watchdog_list, 0, &i); } + +static void +db_gdb(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4) +{ + + if (kdb_dbbe_select("gdb") != 0) + db_printf("The remote GDB backend could not be selected.\n"); + else + db_printf("Step to enter the remote GDB backend.\n"); +}