Remove the need to forward declare statics by moving them around.
This commit is contained in:
parent
a76eb9e4d1
commit
10886230c5
@ -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,
|
||||
@ -371,61 +423,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.
|
||||
|
@ -74,7 +74,19 @@ static vop_readdir_t fdesc_readdir;
|
||||
static vop_reclaim_t fdesc_reclaim;
|
||||
static vop_setattr_t fdesc_setattr;
|
||||
|
||||
extern struct vop_vector fdesc_vnodeops;
|
||||
static struct vop_vector fdesc_vnodeops = {
|
||||
.vop_default = &default_vnodeops,
|
||||
|
||||
.vop_access = VOP_NULL,
|
||||
.vop_getattr = fdesc_getattr,
|
||||
.vop_inactive = fdesc_inactive,
|
||||
.vop_lookup = fdesc_lookup,
|
||||
.vop_open = fdesc_open,
|
||||
.vop_pathconf = vop_stdpathconf,
|
||||
.vop_readdir = fdesc_readdir,
|
||||
.vop_reclaim = fdesc_reclaim,
|
||||
.vop_setattr = fdesc_setattr,
|
||||
};
|
||||
|
||||
/*
|
||||
* Initialise cache headers
|
||||
@ -517,17 +529,3 @@ fdesc_reclaim(ap)
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static struct vop_vector fdesc_vnodeops = {
|
||||
.vop_default = &default_vnodeops,
|
||||
|
||||
.vop_access = VOP_NULL,
|
||||
.vop_getattr = fdesc_getattr,
|
||||
.vop_inactive = fdesc_inactive,
|
||||
.vop_lookup = fdesc_lookup,
|
||||
.vop_open = fdesc_open,
|
||||
.vop_pathconf = vop_stdpathconf,
|
||||
.vop_readdir = fdesc_readdir,
|
||||
.vop_reclaim = fdesc_reclaim,
|
||||
.vop_setattr = fdesc_setattr,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user