diff options
Diffstat (limited to 'share/man/man9/DB_COMMAND.9')
-rw-r--r-- | share/man/man9/DB_COMMAND.9 | 88 |
1 files changed, 78 insertions, 10 deletions
diff --git a/share/man/man9/DB_COMMAND.9 b/share/man/man9/DB_COMMAND.9 index b116a372fbfe..b07281a353ac 100644 --- a/share/man/man9/DB_COMMAND.9 +++ b/share/man/man9/DB_COMMAND.9 @@ -23,24 +23,45 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" -.Dd August 27, 2008 +.Dd July 5, 2023 .Dt DB_COMMAND 9 .Os .Sh NAME .Nm DB_COMMAND , +.Nm DB_COMMAND_FLAGS , .Nm DB_SHOW_COMMAND , -.Nm DB_SHOW_ALL_COMMAND +.Nm DB_SHOW_COMMAND_FLAGS , +.Nm DB_SHOW_ALL_COMMAND , +.Nm DB_TABLE_COMMAND , +.Nm DB_TABLE_COMMAND_FLAGS , +.Nm DB_ALIAS , +.Nm DB_ALIAS_FLAGS , +.Nm DB_SHOW_ALIAS , +.Nm DB_SHOW_ALIAS_FLAGS , +.Nm DB_SHOW_ALL_ALIAS , +.Nm DB_TABLE_ALIAS , +.Nm DB_TABLE_ALIAS_FLAGS +.Nm DB_DECLARE_TABLE , +.Nm DB_DEFINE_TABLE , .Nd Extends the ddb command set .Sh SYNOPSIS .In ddb/ddb.h -.Fo DB_COMMAND -.Fa command_name -.Fa command_function -.Fc +.Fn DB_COMMAND "command_name" "command_function" +.Fn DB_COMMAND_FLAGS "command_name" "command_function" "flags" .Fn DB_SHOW_COMMAND "command_name" "command_function" +.Fn DB_SHOW_COMMAND_FLAGS "command_name" "command_function" "flags" .Fn DB_SHOW_ALL_COMMAND "command_name" "command_function" +.Fn DB_TABLE_COMMAND "table" "command_name" "command_function" +.Fn DB_TABLE_COMMAND_FLAGS "table" "command_name" "command_function" "flags" +.Fn DB_ALIAS "alias_name" "command_function" +.Fn DB_ALIAS_FLAGS "alias_name" "command_function" "flags" +.Fn DB_SHOW_ALIAS "alias_name" "command_function" +.Fn DB_SHOW_ALIAS_FLAGS "alias_name" "command_function" "flags" +.Fn DB_SHOW_ALL_ALIAS "alias_name" "command_function" +.Fn DB_TABLE_ALIAS "table" "alias_name" "command_function" +.Fn DB_TABLE_ALIAS_FLAGS "table" "alias_name" "command_function" "flags" +.Fn DB_DEFINE_TABLE "parent" "name" "table" +.Fn DB_DECLARE_TABLE "table" .Sh DESCRIPTION The .Fn DB_COMMAND @@ -56,7 +77,7 @@ The .Fn DB_SHOW_COMMAND and .Fn DB_SHOW_ALL_COMMAND -are roughly equivalent to +macros are roughly equivalent to .Fn DB_COMMAND but in these cases, .Fa command_name @@ -66,6 +87,33 @@ command and .Sy show all command, respectively. .Pp +The +.Fn DB_TABLE_COMMAND +macro is also similar to +.Fn DB_COMMAND +but adds the new command as a sub-command of the ddb command +.Fa table . +.Pp +The +.Fn DB_ALIAS , +.Fn DB_SHOW_ALIAS , +.Fn DB_SHOW_ALL_ALIAS , +and +.Fn DB_TABLE_ALIAS +macros register the existing +.Fa command_function +under the alternative command name +.Fa alias_name . +.Pp +The _FLAGS variants of these commands allow the programmer to specify a value +for the +.Fa flag +field of the command structure. +The possible flag values are defined alongside +.Ft struct db_command +in +.In ddb/ddb.h . +.Pp The general command syntax: .Cm command Ns Op Li \&/ Ns Ar modifier .Ar address Ns Op , Ns Ar count , @@ -87,7 +135,20 @@ For example, the .Sy examine command will display words in decimal form if it is passed the modifier "d". .El -.Sh EXAMPLE +.Pp +The +.Fn DB_DEFINE_TABLE +macro adds a new command +.Fa name +as a sub-command of the existing command table +.Fa parent . +The new command defines a table named +.Fa table +which contains sub-commands. +New commands and aliases can be added to this table by passing +.Fa table +as the first argument to one of the DB_TABLE_ macros. +.Sh EXAMPLES In your module, the command is declared as: .Bd -literal DB_COMMAND(mycmd, my_cmd_func) @@ -97,11 +158,18 @@ DB_COMMAND(mycmd, my_cmd_func) } .Ed .Pp +An alias for this command is declared as: +.Bd -literal +DB_ALIAS(mycmd2, my_cmd_func); +.Ed +.Pp Then, when in ddb: .Bd -literal .Bf Sy db> mycmd 0x1000 Calling my command with address 0x1000 +db> mycmd2 0x2500 +Calling my command with address 0x2500 db> .Ef .Ed |