DB_COMMAND(9)
π DB_COMMAND(9) π
okay bestie, welcome to the Kernel Developer's Manual β¨ this one's all about DB_COMMAND, DB_SHOW_COMMAND, and DB_SHOW_ALL_COMMAND β the little macros that let you β¨extend the ddb command setβ¨. iykyk. π
πΈ NAME πΈ
DB_COMMAND, DB_SHOW_COMMAND, DB_SHOW_ALL_COMMAND β literally just out here extending the ddb command set, no big deal π
π¦ SYNOPSIS π¦
#include <ddb/ddb.h>
DB_COMMAND(command_name, command_function);
DB_SHOW_COMMAND(command_name, command_function);
DB_SHOW_ALL_COMMAND(command_name, command_function);
β¨ DESCRIPTION β¨
so the DB_COMMAND() macro? it adds command_name to the list of top-level commands, periodt. π and then when you invoke command_name from ddb, it calls command_function. that's it, that's the whole vibe. π«Ά
DB_SHOW_COMMAND() and DB_SHOW_ALL_COMMAND() are roughly equivalent to DB_COMMAND() β like, cousins, sisters, same energy fr fr β but in these cases, command_name is a sub-command of the ddb show command and show all command, respectively. π
okay so the general command syntax:
command[/modifier] address[,count]
...translates into the following parameters for command_function:
addrβ the address passed to the command as an argument. πhave_addrβ a boolean value that is true if theaddrfield is valid. βcountβ the number of quad words starting at offsetaddrthat the command must process. π’modifβ a pointer to the string of modifiers. that is, a series of symbols used to pass some options to the command. for example, theexaminecommand will display words in decimal form if it is passed the modifier"d". π
π EXAMPLE π
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);
}
then, when in ddb:
db> mycmd 0x1000
Calling my command with address 0x1000
db>
ate. no crumbs. π₯
π SEE ALSO π
π AUTHORS π
this manual page was written by Guillaume Ballet <gballet@gmail.com>. iconic behavior honestly π«Ά
and that's the whole page bestie!! this one's coming to you from the Debian crew, dated August 27, 2008 πΈ (yes it's giving vintage but it still slays) β DB_COMMAND(9), mwah, bye πβ¨π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2008 Guillaume Ballet
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms