From nobody Tue Jul 05 15:09:01 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 34B081D02921; Tue, 5 Jul 2022 15:09:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LcmKT4Hlgz3tp2; Tue, 5 Jul 2022 15:09:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657033741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eD2vTf/qcuWLsaPnVhyTTdt708UqurXgOVV4v9voWkA=; b=BmfFtHKWVNPfjQwyMedfFSDbau4M2ZSyPeKgYXKPsYGPmZJcH5OuvfH91s8w1z7aqwLS8v wBbUhSEBtrNicxMqtaGeZYVTuTzXuHozp/K72/nVUuuaQyI6w9CDYEOYenJcQpiMevqSEg Ra/+KQxOh4s8Ow4S2T+rLtPBn6fSYzkXhK2Zr5rhVDU6u51rE5HuIVNOBeRp15KOmkbN4P S+FPZk15bPKrLWBY7dkoV7/j/1h+7f8r3xwqPZNl9y7gbccBbAvwQJgF+dgPhIzTJFzeC5 8rtIsIVvZxvt4m1f6xjEzMF2GskawHgHYVnP7gy0pEBFxRBTERMG7Gnewev0bQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41F5327974; Tue, 5 Jul 2022 15:09:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 265F91N0070025; Tue, 5 Jul 2022 15:09:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 265F91vI070024; Tue, 5 Jul 2022 15:09:01 GMT (envelope-from git) Date: Tue, 5 Jul 2022 15:09:01 GMT Message-Id: <202207051509.265F91vI070024@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: b83d53cb687e - main - DB_COMMAND(9): update to mention additional macros List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b83d53cb687e65372dd23496578c436243b11c93 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657033741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eD2vTf/qcuWLsaPnVhyTTdt708UqurXgOVV4v9voWkA=; b=mzh5lqS+O4rY5teuq9RnzbBxIe7g7eKjR9gL12ek4RzKxAvVnpfOQuiY8CETGsWpT2u4Al udkb8ISat9AgoLfxen4Ct7UZxoAnSiqAGe7m7LBAZHNMJpWYa3CzY1J1SUYVWcS3aGRr2X ws7m0vp9nMsTJks6JR54wHdx3C8KGh4XnIMl49gD4ih2uMTiFkRm7z6ZfZpEilHzWuza9X cuaWbZJ2tv/LDZ4pdCJCO0py9+3Hjb4YGQfIalHYvqguedO7MM4iC4xYsvJMCsD/p2/oui KO+JoFDFzrxMz9gFLdCPo7AduAsPJPdTQhJ6Sp0MXWQorFDOpu4sVLA+BqO5aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657033741; a=rsa-sha256; cv=none; b=MhAL4HhPMrhfh0R54GbEspAeRhpQnLzoDoD33nik5dLapBq2XgQFDLEELcHF0W7lYelEYh KJZ2r3oN0CnpwOUK/wNSrPBgmfLNR7TWeJ16GbDUsI8OgAcFAqefFWNTr4zgmvQPFfW/ij NfZKnKHdDmHAU8S/BTUlEmmmAxlOwuW0EZi3WzyUSrwxmp0g+WSURZhsownMdfF7bWJLD3 /zLTehgflxWyDF6d3Q9gjeFRZKIx36TzabQ4s49Ow/bFmTqSkreUtpVdshQThXntjyHXBS //5lNvH6tE6wuYO/cbcuWVjbzZzWz+S/GWIEsmwlc+D6tCZlPddb5PsgCpCRVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=b83d53cb687e65372dd23496578c436243b11c93 commit b83d53cb687e65372dd23496578c436243b11c93 Author: Mitchell Horne AuthorDate: 2022-07-05 14:55:18 +0000 Commit: Mitchell Horne CommitDate: 2022-07-05 14:56:55 +0000 DB_COMMAND(9): update to mention additional macros Document the existing alias definitions, and augment the example with one of these. Also, describe the purpose of the newly added _FLAGS variations of these command definitions. Make some small style improvements to appease mandoc -Tlint. Reviewed by: markj MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35664 --- share/man/man9/DB_COMMAND.9 | 53 ++++++++++++++++++++++++++++++++++++++------- share/man/man9/Makefile | 11 ++++++++-- 2 files changed, 54 insertions(+), 10 deletions(-) diff --git a/share/man/man9/DB_COMMAND.9 b/share/man/man9/DB_COMMAND.9 index b116a372fbfe..5bd224156f0f 100644 --- a/share/man/man9/DB_COMMAND.9 +++ b/share/man/man9/DB_COMMAND.9 @@ -25,22 +25,33 @@ .\" .\" $FreeBSD$ .\" -.Dd August 27, 2008 +.Dd June 24, 2022 .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_ALIAS , +.Nm DB_ALIAS_FLAGS , +.Nm DB_SHOW_ALIAS , +.Nm DB_SHOW_ALIAS_FLAGS , +.Nm DB_SHOW_ALL_ALIAS .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_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" .Sh DESCRIPTION The .Fn DB_COMMAND @@ -56,7 +67,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 +77,25 @@ command and .Sy show all command, respectively. .Pp +The +.Fn DB_ALIAS , +.Fn DB_SHOW_ALIAS , +and +.Fn DB_SHOW_ALL_ALIAS +macros register the exsting +.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 +117,7 @@ For example, the .Sy examine command will display words in decimal form if it is passed the modifier "d". .El -.Sh EXAMPLE +.Sh EXAMPLES In your module, the command is declared as: .Bd -literal DB_COMMAND(mycmd, my_cmd_func) @@ -97,11 +127,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 diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index e1d2d66b8a26..1913f03a48fd 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -965,8 +965,15 @@ MLINKS+=crypto_session.9 crypto_auth_hash.9 \ crypto_session.9 crypto_get_params.9 \ crypto_session.9 crypto_newsession.9 \ crypto_session.9 crypto_freesession.9 -MLINKS+=DB_COMMAND.9 DB_SHOW_ALL_COMMAND.9 \ - DB_COMMAND.9 DB_SHOW_COMMAND.9 +MLINKS+=DB_COMMAND.9 DB_ALIAS.9 \ + DB_COMMAND.9 DB_ALIAS_FLAGS.9 \ + DB_COMMAND.9 DB_COMMAND_FLAGS.9 \ + DB_COMMAND.9 DB_SHOW_ALIAS.9 \ + DB_COMMAND.9 DB_SHOW_ALIAS_FLAGS.9 \ + DB_COMMAND.9 DB_SHOW_ALL_ALIAS.9 \ + DB_COMMAND.9 DB_SHOW_ALL_COMMAND.9 \ + DB_COMMAND.9 DB_SHOW_COMMAND.9 \ + DB_COMMAND.9 DB_SHOW_COMMAND_FLAGS.9 MLINKS+=DECLARE_MODULE.9 DECLARE_MODULE_TIED.9 MLINKS+=dev_clone.9 drain_dev_clone_events.9 MLINKS+=dev_refthread.9 devvn_refthread.9 \