- NetBSD Manual Pages
DDB(9) NetBSD Kernel Developer's Manual DDB(9)
Powered by man-cgi (2021-06-01).
Maintained for NetBSD
by Kimmo Suominen.
Based on man-cgi by Panagiotis Christias.
ddb -- in-kernel debugger
db_register_tbl(uint8_t type, const struct db_command *commands);
db_unregister_tbl(uint8_t type, const struct db_command *commands);
(*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);
Devices and kernel modules can add new commands to the ddb(4) in-kernel
debugger with db_register_tbl() and remove previously added commands with
The type argument is one of:
DDB_BASE_CMD top-level commands;
DDB_MACH_CMD sub-commands of the top-level mach command;
DDB_SHOW_CMD sub-commands of the top-level show command.
The commands argument is an array of struct db_command entries. The ini-
tializer 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 debug-
ger'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 The command takes the usual arguments but may addi-
tionally parse the remainder of its command line.
CS_NOREPEAT The command should not be automatically repeated by
the REPL when the user enters an empty command after
CS_OWN The command doesn't follow the normal ddb(4) conven-
tions and parses its command line itself. The REPL
doesn't try to parse the command line. The values
passed to its implementation are dummies.
CS_SET_DOT The command sets the 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
NetBSD 9.99 October 30, 2020 NetBSD 9.99