DDB(9) | Kernel Developer's Manual | DDB(9) |
ddb
—
#include <ddb/ddb.h>
int
db_register_tbl
(uint8_t
type, const struct
db_command *commands);
int
db_unregister_tbl
(uint8_t
type, const struct
db_command *commands);
void
(*pf)
(db_expr_t addr,
bool have_addr, db_expr_t count,
const char *modif);
DDB_ADD_CMD
(const char
*name, void (*pf)(db_expr_t, bool, db_expr_t, const
char *), uint16_t flags, const
char *cmd_descr, const char *cmd_arg,
const char *arg_desc);
db_register_tbl
() and remove previously added commands
with db_unregister_tbl
() respectively.
The type argument is one of:
DDB_BASE_CMD
DDB_MACH_CMD
mach
command;DDB_SHOW_CMD
show
command.The commands argument is an array of
struct db_command entries. The initializer list for
the array should use the DDB_ADD_CMD
() macro for its
entries. The name argument is the name of the debugger
command. An entry with NULL
name terminates the array.
The pf argument is the function that implements the command. The debugger's REPL parses the usual command format documented in ddb(4) and invokes the implementation with the values obtained.
The flags argument is a bitwise OR of the following values:
CS_MORE
CS_NOREPEAT
CS_OWN
CS_SET_DOT
The remaining parameters are strings that provide documentation
for the command and its arguments. That documentation is available to the
user via the help
command if the kernel was compiled
with the DDB_VERBOSE_HELP
option.
October 30, 2020 | NetBSD 10.1 |