diff options
author | obrien <obrien@FreeBSD.org> | 2005-08-10 07:08:14 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2005-08-10 07:08:14 +0000 |
commit | 10886230c53539a656a717ab29490a1c70d2d067 (patch) | |
tree | 35f08188ba281744ccef0f94e329ed81d25c8733 /sys/ddb/db_command.c | |
parent | a76eb9e4d13cf47aeb9ea9514ccac386f01b76fc (diff) | |
download | FreeBSD-src-10886230c53539a656a717ab29490a1c70d2d067.zip FreeBSD-src-10886230c53539a656a717ab29490a1c70d2d067.tar.gz |
Remove the need to forward declare statics by moving them around.
Diffstat (limited to 'sys/ddb/db_command.c')
-rw-r--r-- | sys/ddb/db_command.c | 111 |
1 files changed, 54 insertions, 57 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index 238a9f9..d20c4a3 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -73,8 +73,60 @@ static db_cmdfcn_t db_reset; static db_cmdfcn_t db_stack_trace; 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 }, + { "where", 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 }, + { "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, @@ -372,61 +424,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 }, - { "where", 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 }, - { "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. */ |