enable dynamic addition of "show all" commands
MFC after: 3 weeks
This commit is contained in:
parent
9c8408a472
commit
9e340a6190
sys/ddb
@ -65,6 +65,7 @@ db_addr_t db_next;
|
||||
|
||||
SET_DECLARE(db_cmd_set, struct command);
|
||||
SET_DECLARE(db_show_cmd_set, struct command);
|
||||
SET_DECLARE(db_show_all_cmd_set, struct command);
|
||||
|
||||
static db_cmdfcn_t db_fncall;
|
||||
static db_cmdfcn_t db_gdb;
|
||||
@ -80,12 +81,13 @@ static db_cmdfcn_t db_watchdog;
|
||||
*/
|
||||
|
||||
static struct command db_show_all_cmds[] = {
|
||||
{ "procs", db_ps, 0, 0 },
|
||||
{ (char *)0 }
|
||||
};
|
||||
|
||||
static struct command_table db_show_all_table = {
|
||||
db_show_all_cmds
|
||||
db_show_all_cmds,
|
||||
SET_BEGIN(db_show_all_cmd_set),
|
||||
SET_LIMIT(db_show_all_cmd_set)
|
||||
};
|
||||
|
||||
static struct command db_show_cmds[] = {
|
||||
|
@ -46,6 +46,15 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
static void dumpthread(volatile struct proc *p, volatile struct thread *td,
|
||||
int all);
|
||||
/*
|
||||
* At least one non-optional show-command must be implemented using
|
||||
* DB_SHOW_ALL_COMMAND() so that db_show_all_cmd_set gets created.
|
||||
* Here is one.
|
||||
*/
|
||||
DB_SHOW_ALL_COMMAND(procs, db_procs_cmd)
|
||||
{
|
||||
db_ps(addr, have_addr, count, modif);
|
||||
}
|
||||
|
||||
/*
|
||||
* Layout:
|
||||
|
@ -80,6 +80,8 @@ typedef void db_cmdfcn_t(db_expr_t addr, boolean_t have_addr, db_expr_t count,
|
||||
DB_FUNC(cmd_name, func_name, db_cmd_set, 0, NULL)
|
||||
#define DB_SHOW_COMMAND(cmd_name, func_name) \
|
||||
DB_FUNC(cmd_name, func_name, db_show_cmd_set, 0, NULL)
|
||||
#define DB_SHOW_ALL_COMMAND(cmd_name, func_name) \
|
||||
DB_FUNC(cmd_name, func_name, db_show_all_cmd_set, 0, NULL)
|
||||
|
||||
#define DB_SET(cmd_name, func_name, set, flag, more) \
|
||||
static const struct command __CONCAT(cmd_name,_cmd) = { \
|
||||
|
Loading…
x
Reference in New Issue
Block a user