From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1256) id 4DA1A3858D28; Wed, 18 Jan 2023 23:39:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DA1A3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674085167; bh=DqajkK02tBFBaFxEvt4rF/Af+DRKd8B87Yr0iZL1tHE=; h=From:To:Subject:Date:From; b=f364r1pxckOKWbxDbmBIFFqHiN9Tn14d2Cbfk/4FyIWDUx66UGtN0FjimU7UU1zeu fdHLRiSovt2oHtX27W3XWKYC8kNtgjNfRHrS3Q4ma02oHCXpV9TQPT/5DbT869vZQd 7q2xK3bSLJC7ql2Nbg9lJ162tKgLg9J97krMG9jw= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Maciej W. Rozycki To: gdb-cvs@sourceware.org Subject: [binutils-gdb] GDB: Add references to erased args in cli-decode.c X-Act-Checkin: binutils-gdb X-Git-Author: Maciej W. Rozycki X-Git-Refname: refs/heads/master X-Git-Oldrev: 439ee793446b911989defb21902829519a2a1908 X-Git-Newrev: 0e38c6ff4fa33550f93e3bf7eecac52b3ea7379f Message-Id: <20230118233927.4DA1A3858D28@sourceware.org> Date: Wed, 18 Jan 2023 23:39:27 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D0e38c6ff4fa3= 3550f93e3bf7eecac52b3ea7379f commit 0e38c6ff4fa33550f93e3bf7eecac52b3ea7379f Author: Maciej W. Rozycki Date: Wed Jan 18 23:38:50 2023 +0000 GDB: Add references to erased args in cli-decode.c =20 Complement commit 1d7fe7f01b93 ("gdb: Introduce setting construct within cmd_list_element") and commit 702991711a91 ("gdb: Have setter and getter callbacks for settings") and update inline documentation accordingly for `add_set_or_show_cmd' and `add_setshow_cmd_full_erased', documenting the `args' parameter and removing references to `var', `set_setting_func' and `get_setting_func'. =20 Approved-By: Simon Marchi Diff: --- gdb/cli/cli-decode.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 72b1f31b0a6..fdc29c04f27 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -496,11 +496,8 @@ empty_func (const char *args, int from_tty, cmd_list_e= lement *c) TYPE is set_cmd or show_cmd. THECLASS is as in add_cmd. VAR_TYPE is the kind of thing we are setting. - VAR is address of the variable being controlled by this command. - SET_SETTING_FUNC is a pointer to an optional function callback used to = set - the setting value. - GET_SETTING_FUNC is a pointer to an optional function callback used to = get - the setting value. + ARGS is a pre-validated type-erased reference to the variable being + controlled by this command. DOC is the documentation string. */ =20 static struct cmd_list_element * @@ -526,12 +523,10 @@ add_set_or_show_cmd (const char *name, =20 /* Add element named NAME to both command lists SET_LIST and SHOW_LIST. THECLASS is as in add_cmd. VAR_TYPE is the kind of thing we are - setting. VAR is address of the variable being controlled by this - command. If nullptr is given as VAR, then both SET_SETTING_FUNC and - GET_SETTING_FUNC must be provided. SET_SETTING_FUNC and GET_SETTING_FUN= C are - callbacks used to access and modify the underlying property, whatever i= ts - storage is. SET_FUNC and SHOW_FUNC are the callback functions (if non-= NULL). - SET_DOC, SHOW_DOC and HELP_DOC are the documentation strings. + setting. ARGS is a pre-validated type-erased reference to the + variable being controlled by this command. SET_FUNC and SHOW_FUNC + are the callback functions (if non-NULL). SET_DOC, SHOW_DOC and + HELP_DOC are the documentation strings. =20 Return the newly created set and show commands. */