From nobody Thu Aug 11 14:32:52 2022 X-Original-To: dev-commits-src-all@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 4M3Tmh62R2z4Y24P; Thu, 11 Aug 2022 14:32:52 +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 4M3Tmh5Mb8z3Mgt; Thu, 11 Aug 2022 14:32:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660228372; 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=zNarUNb0TPGBQT81ZpmE9Vh4OoufXFO0GxxLUDKmNJw=; b=uZl4D+YHCSQCNv8cZjxFZGYkqI979PsR1fPC9E7ZqDE/PwEfpYWtLcoHh8vJrJ+PIDvHmn GOtbYLEeILewwVTZo9Fyf0JI3LwfiOBcDBMx7klLGLb/yob+EsFG+0y/NRIo41rSNRiCAB XGOuo9tnKCMlnD07dPTJvIVtPC27ZUtnwW/n3z62khuO3WfG1pDotoEtMc0yWIkd7StuxS Wnp9lVkACBQcqSQjVSB4aisLCdQZQ+2YQO/kn4y0cIMJ8w2Qcb0OFWgif87OiDtkiKS4p2 FixGAF8le6TqKbj8OY5pcgJ+VwU6UsVoTnbS7l9/0Oiew0kDsI387bSbzxNz+w== 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 4M3Tmh4F6QzvWd; Thu, 11 Aug 2022 14:32:52 +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 27BEWqIc004623; Thu, 11 Aug 2022 14:32:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27BEWqgH004622; Thu, 11 Aug 2022 14:32:52 GMT (envelope-from git) Date: Thu, 11 Aug 2022 14:32:52 GMT Message-Id: <202208111432.27BEWqgH004622@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: c47c706b52c2 - stable/13 - DB_COMMAND(9): update to mention additional macros List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: c47c706b52c23af8a4132ab80a21fc72d0cb457f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660228372; 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=zNarUNb0TPGBQT81ZpmE9Vh4OoufXFO0GxxLUDKmNJw=; b=nXEr9i87TfXgPpWRP+uuOOnztDV+cRNj+tjASrzwZXKnpITwfimz9ZBI6PJkDquTghCj87 MDHJ2ksdID+jAs///kfFbwYFz2taSjwyf6idp2ypkWZGLAMDkCEMu4sVV7uiadIC8WJKRp blKCRRpvzA5Tv6tngHY6Inlo2hsRkICPKtoWmWMX2HHfqcELlBAr6Fd6irPmmyGrcLWSWq ws6gcn+L+ui44bgRG3ZryoNzLHqPAPjVyReKNIE5F47XqDvDFW/sVRZLQUtPFbyKkxxb5o sR9fF0isHCy34Z3wNivbyf1fMV1AjUd/Rstk8llDrjcOJ6f9TBTAhL1h3E5Zbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660228372; a=rsa-sha256; cv=none; b=yteKQaaJemh8d6kML/dxhJ0UWXbrxqMt3qcY6IL9la8rWhj4SfZl+kTb0KAp6lBmPiHqrC bEJxa+Hk+KkBSFmIQafGyKiQCFUr2/HoN6nvjbeGaquNfGxSrLK6fAkpIskV0TMbW4IbDQ Mqn3tQxBQMEKUjCEc3w2ofUzgCWgLJ2QZP9W9+UlxlD+7HOf1rgeTObvBMMwg43kO160Bc BFKfqLDeAdmLtB8OYLzds5NtKOtBuRI4qh8gYPiKL+XrHdnzwGyhi2WhNpSU5NKn3+haf/ LE2xX0ue3FTOOAtrgSNT+cyNFQwR1BYkrlbBPrKvAOSg9S8Sz0RUEj2XCQ1mvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=c47c706b52c23af8a4132ab80a21fc72d0cb457f commit c47c706b52c23af8a4132ab80a21fc72d0cb457f Author: Mitchell Horne AuthorDate: 2022-07-05 14:55:18 +0000 Commit: Mitchell Horne CommitDate: 2022-08-11 14:26:48 +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 (cherry picked from commit b83d53cb687e65372dd23496578c436243b11c93) (cherry picked from commit 62bca9c4df3af8ddeb08f910959fdf6d5084679f) --- 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..15c2adce3580 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 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 +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 0c686813118e..df62bb02b7c8 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -968,8 +968,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 \