| DB_COMMAND(9) | MidnightBSD Kernel Developer's Manual | DB_COMMAND(9) |
DB_COMMAND,
DB_COMMAND_FLAGS,
DB_SHOW_COMMAND,
DB_SHOW_COMMAND_FLAGS,
DB_SHOW_ALL_COMMAND,
DB_ALIAS, DB_ALIAS_FLAGS,
DB_SHOW_ALIAS,
DB_SHOW_ALIAS_FLAGS,
DB_SHOW_ALL_ALIAS — Extends
the ddb command set
#include
<ddb/ddb.h>
DB_COMMAND(command_name,
command_function);
DB_COMMAND_FLAGS(command_name,
command_function,
flags);
DB_SHOW_COMMAND(command_name,
command_function);
DB_SHOW_COMMAND_FLAGS(command_name,
command_function,
flags);
DB_SHOW_ALL_COMMAND(command_name,
command_function);
DB_ALIAS(alias_name,
command_function);
DB_ALIAS_FLAGS(alias_name,
command_function,
flags);
DB_SHOW_ALIAS(alias_name,
command_function);
DB_SHOW_ALIAS_FLAGS(alias_name,
command_function,
flags);
DB_SHOW_ALL_ALIAS(alias_name,
command_function);
The
DB_COMMAND()
macro adds command_name to the list of top-level
commands. Invoking command_name from ddb will call
command_function.
The
DB_SHOW_COMMAND()
and
DB_SHOW_ALL_COMMAND()
macros are roughly equivalent to DB_COMMAND() but in
these cases, command_name is a sub-command of the ddb
show command and show all command,
respectively.
The
DB_ALIAS(),
DB_SHOW_ALIAS(),
and
DB_SHOW_ALL_ALIAS()
macros register the existing command_function under
the alternative command name alias_name.
The _FLAGS variants of these commands allow the programmer to
specify a value for the flag field of the command
structure. The possible flag values are defined alongside
struct db_command in
<ddb/ddb.h>.
The general command syntax:
command[/modifier]
address[,count], translates into
the following parameters for command_function:
In your module, the command is declared as:
DB_COMMAND(mycmd, my_cmd_func)
{
if (have_addr)
db_printf("Calling my command with address %p\n", addr);
}
An alias for this command is declared as:
DB_ALIAS(mycmd2, my_cmd_func);
Then, when in ddb:
This manual page was written by Guillaume Ballet <gballet@gmail.com>.
| June 24, 2022 | midnightbsd-4.0 |