From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 2CBE33857026 for ; Thu, 24 Nov 2022 11:22:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2CBE33857026 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x436.google.com with SMTP id n7so1987989wrr.13 for ; Thu, 24 Nov 2022 03:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=30PTDCCS71BV/ft9mQmD5geUaPR8afZf8ggpEEomyN0=; b=KZ/z/BpUaD7gJBbljcUeFEKMo/LmI9zXnaQdnr82Ns4pCyJ+5caB/A8Js0KfZhUR3n GrFa7/ojo6lZ2P3HF8AYoBskfcfp+oSV/P/IHFqlvV9VK96dL/n1iFAdyP81sZa86t5B K/XdjG+QrRqjnyUojETzjZ9D5T9+pN7Aiz0qmOc0sOJ9NC4brUfpoYkCspdizRynWbj3 KWMmmc9ceGgba8YfjCQT97AA+Z1EQqPrIV2kjoHi65z/Q8McE2y/cCYuCAbXwwI7lIZX FwcBlKoPXiSqynyd1Sh5l/63UozhdUi8P77fgg4GU+FCg0d805I3esHBi0uMI9LVZQtL td9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:references:message-id:in-reply-to:subject :cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=30PTDCCS71BV/ft9mQmD5geUaPR8afZf8ggpEEomyN0=; b=Oi8mZQueeVq9Ft5dk5IPeWRV+Z/XVE45HZvqSr1GUMjO7d8iuq1IYzYNSxmYy7IWbv YgscVHb4IB1itQdt66m5KoTc1gU9T4ra/Vs5cDx4/Dq57A6rmq01OQDdzBtDglcH5Jyn y8afSw9X253IFJN8ESio89vxqWINA59TGlgMd+Q0vMJYnfQrzl4FJhZCsDx1r8SAZdF1 btPUyISiqAz9vAYhQZEZPjRbdbUC192bO6VRTKwNV/uReV86wS7/N1iWdCgCovY2DCFg oNhuKIMwk+Zs6EkLNogK7CMEB/c7sufzAuI7VzIUUUtkYvocPzi8nq2QF6wbl3GTp9uq bAJw== X-Gm-Message-State: ANoB5pm3chlLLUy1YRzjSrhxH/Wrx36TBWtEx7eB9mvvLY+2DZweD1wu KT8lb2mwrXBWfDTNQCkOm9mWyrg+6glteqUf X-Google-Smtp-Source: AA0mqf6aBAvOh7trwwYmhZQerZl8i5UvJNRUp8ADfxEIaOt2LcIstYmNp2/ofFx/K1wCytwfUIMpPg== X-Received: by 2002:adf:df09:0:b0:236:885e:ef4b with SMTP id y9-20020adfdf09000000b00236885eef4bmr19911593wrl.13.1669288940972; Thu, 24 Nov 2022 03:22:20 -0800 (PST) Received: from tpp.orcam.me.uk (tpp.orcam.me.uk. [2001:8b0:154:0:ea6a:64ff:fe24:f2fc]) by smtp.gmail.com with ESMTPSA id i9-20020adfdec9000000b00228dbf15072sm1091558wrn.62.2022.11.24.03.22.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Nov 2022 03:22:20 -0800 (PST) Date: Thu, 24 Nov 2022 11:22:19 +0000 (GMT) From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: Andrew Burgess , Simon Marchi , Tom Tromey , Simon Sobisch Subject: [PATCH v8 3/6] GDB: Add references to erased args in cli-decode.c In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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'. --- New change in v8. --- gdb/cli/cli-decode.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) gdb-setshow-cmd-erased-args-doc.diff Index: src/gdb/cli/cli-decode.c =================================================================== --- src.orig/gdb/cli/cli-decode.c +++ src/gdb/cli/cli-decode.c @@ -496,11 +496,8 @@ empty_func (const char *args, int from_t 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. */ static struct cmd_list_element * @@ -526,12 +523,10 @@ add_set_or_show_cmd (const char *name, /* Add element named NAME to both the command 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_FUNC are - callbacks used to access and modify the underlying property, whatever its - 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. Return the newly created set and show commands. */