| Main index | Section 9 | Options |
#include <ddb/ddb.h>
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[amp;/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 the addr field is valid. | |
| count | |
| The number of quad words starting at offset addr that 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, the examine command will display words in decimal form if it is passed the modifier "d". | |
DB_COMMAND(mycmd, my_cmd_func)
{
if (have_addr)
db_printf("Calling my command with address %p , addr);
}
An alias for this command is declared as:
DB_ALIAS(mycmd2, my_cmd_func);
Then, when in ddb:
db> mycmd 0x1000
Calling my command with address 0x1000
db> mycmd2 0x2500
Calling my command with address 0x2500
db>
| DB_COMMAND (9) | June 24, 2022 |
| Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. | ” |
| — Jamie Zawinski | ||