From f51c24d750130fa400893b2949ccc416cfdefbba Mon Sep 17 00:00:00 2001 From: obrien Date: Tue, 23 Oct 2007 16:07:30 +0000 Subject: [PATCH] MFC: rev. 1.61: remove the need to forward declare statics. --- sys/ddb/db_command.c | 120 +++++++++++++++++++++---------------------- 1 file changed, 59 insertions(+), 61 deletions(-) diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 31d1494f0cc7..50d48d68644f 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -75,8 +75,65 @@ static db_cmdfcn_t db_stack_trace; static db_cmdfcn_t db_stack_trace_all; static db_cmdfcn_t db_watchdog; -/* XXX this is actually forward-static. */ -extern struct command db_show_cmds[]; +/* + * 'show' commands + */ + +static struct command db_show_all_cmds[] = { + { "procs", db_ps, 0, 0 }, + { (char *)0 } +}; + +static struct command db_show_cmds[] = { + { "all", 0, 0, db_show_all_cmds }, + { "registers", db_show_regs, 0, 0 }, + { "breaks", db_listbreak_cmd, 0, 0 }, + { "threads", db_show_threads, 0, 0 }, + { (char *)0, } +}; + +static struct command db_command_table[] = { + { "print", db_print_cmd, 0, 0 }, + { "p", db_print_cmd, 0, 0 }, + { "examine", db_examine_cmd, CS_SET_DOT, 0 }, + { "x", db_examine_cmd, CS_SET_DOT, 0 }, + { "search", db_search_cmd, CS_OWN|CS_SET_DOT, 0 }, + { "set", db_set_cmd, CS_OWN, 0 }, + { "write", db_write_cmd, CS_MORE|CS_SET_DOT, 0 }, + { "w", db_write_cmd, CS_MORE|CS_SET_DOT, 0 }, + { "delete", db_delete_cmd, 0, 0 }, + { "d", db_delete_cmd, 0, 0 }, + { "break", db_breakpoint_cmd, 0, 0 }, + { "dwatch", db_deletewatch_cmd, 0, 0 }, + { "watch", db_watchpoint_cmd, CS_MORE,0 }, + { "dhwatch", db_deletehwatch_cmd, 0, 0 }, + { "hwatch", db_hwatchpoint_cmd, 0, 0 }, + { "step", db_single_step_cmd, 0, 0 }, + { "s", db_single_step_cmd, 0, 0 }, + { "continue", db_continue_cmd, 0, 0 }, + { "c", db_continue_cmd, 0, 0 }, + { "until", db_trace_until_call_cmd,0, 0 }, + { "next", db_trace_until_matching_cmd,0, 0 }, + { "match", db_trace_until_matching_cmd,0, 0 }, + { "trace", db_stack_trace, CS_OWN, 0 }, + { "alltrace", db_stack_trace_all, 0, 0 }, + { "where", db_stack_trace, CS_OWN, 0 }, + { "bt", db_stack_trace, CS_OWN, 0 }, + { "call", db_fncall, CS_OWN, 0 }, + { "show", 0, 0, db_show_cmds }, + { "ps", db_ps, 0, 0 }, + { "gdb", db_gdb, 0, 0 }, + { "halt", db_halt, 0, 0 }, + { "reboot", db_reset, 0, 0 }, + { "reset", db_reset, 0, 0 }, + { "kill", db_kill, CS_OWN, 0 }, + { "watchdog", db_watchdog, 0, 0 }, + { "thread", db_set_thread, CS_OWN, 0 }, + { (char *)0, } +}; + +static struct command *db_last_command = 0; + /* * if 'ed' style: 'dot' is set at start of last item printed, @@ -373,65 +430,6 @@ db_command(last_cmdp, cmd_table, aux_cmd_tablep, aux_cmd_tablep_end) } } -/* - * 'show' commands - */ - -static struct command db_show_all_cmds[] = { - { "procs", db_ps, 0, 0 }, - { (char *)0 } -}; - -static struct command db_show_cmds[] = { - { "all", 0, 0, db_show_all_cmds }, - { "registers", db_show_regs, 0, 0 }, - { "breaks", db_listbreak_cmd, 0, 0 }, - { "threads", db_show_threads, 0, 0 }, - { (char *)0, } -}; - -static struct command db_command_table[] = { - { "print", db_print_cmd, 0, 0 }, - { "p", db_print_cmd, 0, 0 }, - { "examine", db_examine_cmd, CS_SET_DOT, 0 }, - { "x", db_examine_cmd, CS_SET_DOT, 0 }, - { "search", db_search_cmd, CS_OWN|CS_SET_DOT, 0 }, - { "set", db_set_cmd, CS_OWN, 0 }, - { "write", db_write_cmd, CS_MORE|CS_SET_DOT, 0 }, - { "w", db_write_cmd, CS_MORE|CS_SET_DOT, 0 }, - { "delete", db_delete_cmd, 0, 0 }, - { "d", db_delete_cmd, 0, 0 }, - { "break", db_breakpoint_cmd, 0, 0 }, - { "dwatch", db_deletewatch_cmd, 0, 0 }, - { "watch", db_watchpoint_cmd, CS_MORE,0 }, - { "dhwatch", db_deletehwatch_cmd, 0, 0 }, - { "hwatch", db_hwatchpoint_cmd, 0, 0 }, - { "step", db_single_step_cmd, 0, 0 }, - { "s", db_single_step_cmd, 0, 0 }, - { "continue", db_continue_cmd, 0, 0 }, - { "c", db_continue_cmd, 0, 0 }, - { "until", db_trace_until_call_cmd,0, 0 }, - { "next", db_trace_until_matching_cmd,0, 0 }, - { "match", db_trace_until_matching_cmd,0, 0 }, - { "trace", db_stack_trace, CS_OWN, 0 }, - { "alltrace", db_stack_trace_all, 0, 0 }, - { "where", db_stack_trace, CS_OWN, 0 }, - { "bt", db_stack_trace, CS_OWN, 0 }, - { "call", db_fncall, CS_OWN, 0 }, - { "show", 0, 0, db_show_cmds }, - { "ps", db_ps, 0, 0 }, - { "gdb", db_gdb, 0, 0 }, - { "halt", db_halt, 0, 0 }, - { "reboot", db_reset, 0, 0 }, - { "reset", db_reset, 0, 0 }, - { "kill", db_kill, CS_OWN, 0 }, - { "watchdog", db_watchdog, 0, 0 }, - { "thread", db_set_thread, CS_OWN, 0 }, - { (char *)0, } -}; - -static struct command *db_last_command = 0; - /* * At least one non-optional command must be implemented using * DB_COMMAND() so that db_cmd_set gets created. Here is one.