From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4bVVN/2Q9GpvUAIAWB0awg (envelope-from ) for ; Wed, 11 Nov 2026 10:59:57 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=iahG4bB8; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id DC831378002; Wed, 11 Nov 2026 10:59:57 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5638B1E04F for ; Wed, 11 Nov 2026 10:59:57 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DDD1C4B920FA for ; Wed, 11 Nov 2026 15:59:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DDD1C4B920FA Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=iahG4bB8 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by sourceware.org (Postfix) with ESMTPS id 8E6444B92098 for ; Wed, 11 Nov 2026 15:59:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8E6444B92098 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8E6444B92098 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794412761; cv=none; b=A7lMSkY78Ji+rfnR3zjyJYjhnc8a3qvpIDBM41sE+9LctUdsAX+ZWN9EiS7sa0qtc7rC8no5PrPqSWdbHjT5NY+IYehcmpIpd+woVhCtLVUoZBKK/Y+YULtZXxwW96hn6Zwl/JD/2XZbc2AMKNjDoFKFMP7+KxHwIVt50eEa9fw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794412761; c=relaxed/simple; bh=3KGVUX3VouLlFSGqLCyP1YvgPeemARNVWXYzm063scg=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=fuwvYRR9TuVmn+L1o5gCTwAU53QU8/ET8RA/ezH+Uj+kZaYIGz0lINF6QUhRdg02tNorIq3NY7h5JcQajRC2xU85boA7UmHrY4950TLppBjcbDf6mPFO+3hR2E+kmAcYpSE4ZdDCAHycgDRZtsm/ORFT4R3yddO+W3Ggra8Lb80= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=iahG4bB8 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E6444B92098 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-84d5e56f876so2198304a34.3 for ; Wed, 11 Nov 2026 07:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1794412761; x=1795017561; darn=sourceware.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=4oBoJhDtGdaTVx8ZCSd0dGp7TejeV518vxjhCKwERsw=; b=iahG4bB8HGObAgrehV7/rupPWMN3cYVrohbviiImYyFWeAc5na0GXO/bgRiCCC6iiA JL6nRgLAoOQ1MDRLhMUAzRiKLju8840tYPJpU7idLaubQcwoHYwREn84o6Q0yDLTR7QY Qr8f3fOoz2Etpu4CSJ1emhDxbblxH1YdkUyhnmbI3PBseJF2gOZmxQZ4SCyEkLwh4YI4 +truV87fi/oI4B/aEzSJIVIUTGBB5/7Fls0m8zp3s5AhdZTBpy0VnWfPHEiuEHsau9IH 5wJuAn0/UfKYrjczgJEpfzzJbVjlD0Jmi2XfTb5USYYh1w/81WrwbgEJi2VpfcH0A9my DRCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794412761; x=1795017561; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=4oBoJhDtGdaTVx8ZCSd0dGp7TejeV518vxjhCKwERsw=; b=yJ7CEUnXuqQsWdmmLNVQWqGgejSOMeSUIr13SG+Yljva0KnfI9Zh4hHNNf14s2sx91 jjXP1thiK4N2H9F0w0FPuFRby1Btl1PGhx6/K3H9ZGCoArnu1wnxCN0lPouAdo2vN3MJ /IQtUGDi2jkArC6m4h8/oiXAdqCUqEx5kmqe5wNoD3XT60r5nvdZkTTtUW6dhGVDENwt yDhz4iN3eUA9yhI/yrTab2SAbZh9MkdQag7829rt6D1IzuqEsUcxB4KWbqg7BzSl7g6Q 7sb3dga0CfRtca43Mw8uSot79fwmeogXg6sH/VTN6vgVAl5DIjeSAv2kykeZQxWK+/c1 Ng2g== X-Gm-Message-State: APuU4Z/QNCN2QxBwmQaAy3zxpuDBVw9E2YoUtMhwQ42BrSANpMhy2qDB sWvcWhA+FeEvqIYGuDlzgUNF3iq5nFT9e37jcyakCBggydb42TKw2B5c7jNAJClM0H+jk1tIkFc qjhrXhw== X-Gm-Gg: AYBFou3M5c3ZTVusAykiByBfoHUPfPHUGp/p2+ZjqPCwz+qncqzaKAPYIwz+7i34IhN tCbcdo/UnKAunL//7x31BNZl1fwWi3MrEv5zC7xdtH+2LnXFOwRUktRb7vIwFDsbV+YKN7DXh4Z 5YyPNAVowcjWsZA0HPYU21UphNYG1zwx4wKcGooD4QAbn2p6XvZH0YSXjANzS63P6hLaXqGCNX+ iuHDx2TY2tqBv8OuXn7s8/CuTL38KHmFXq5im4rtrDT5DTLsSj2zihI9IrCaQYVV5OO2jCNJDaS VQqr2beAnoncqZOPEcf+ZvaczbuhROvAhA31fjOuWR1eT6EOx7sDk0SvHB6EE1Sj34y5ox+Cfjb gI/N9rtsh2slzL31ip5CqJzD37fsxFCuExMHrjgy5OWM9HBVqohZug7fvXZjonoCX562BZ9H2M5 Wb9b7D7EQqQDIo2xT+woxrPxvov9SXtmhNJvuXnYL5PMkgIvDT6iQD/tCh8w9ngyXC6+HQG0HuH PDCtaMDAFHSPMtPj2Kher3fkXgOhBcCLgn0qYMBduVgLhvJRjx7ZLop2n1yKchiDEJ18YylzBnw YrRbjOmfDqMIFiftz43fNUJAQfi/5xDG3DEVV4my1zJbe1XjsTiQCrSTmohhew== X-Received: by 2002:a05:6820:6703:b0:702:f7c2:1937 with SMTP id 006d021491bc7-71917966a00mr1435917eaf.83.1794412760765; Wed, 11 Nov 2026 07:59:20 -0800 (PST) Received: from [192.168.0.26] (97-122-110-129.hlrn.qwest.net. [97.122.110.129]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4ae2308e3ccsm3497521fac.15.2026.11.11.07.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2026 07:59:19 -0800 (PST) From: Tom Tromey Date: Wed, 11 Nov 2026 08:58:56 -0700 Subject: [PATCH v2 08/15] Remove span from cli-option.c:build_help_option MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261111-span-part-1-v2-8-cd4e33a8a723@adacore.com> References: <20261111-span-part-1-v2-0-cd4e33a8a723@adacore.com> In-Reply-To: <20261111-span-part-1-v2-0-cd4e33a8a723@adacore.com> To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.16.0 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org cli-option.c:build_help_option takes a gdb::span argument, but it is only ever passed a single option_def. This patch simplifies the function. --- gdb/cli/cli-option.c | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/gdb/cli/cli-option.c b/gdb/cli/cli-option.c index b4fafaa898c..70878bebe69 100644 --- a/gdb/cli/cli-option.c +++ b/gdb/cli/cli-option.c @@ -866,28 +866,22 @@ append_indented_doc (const char *doc, std::string &help) OPTIONS. */ static void -build_help_option (gdb::span options, - std::string &help) +build_help_option (const option_def &option, std::string &help) { - std::string buffer; - - for (const auto &o : options) - { - if (o.set_doc == nullptr) - continue; + if (option.set_doc == nullptr) + return; - size_t initial_len = help.length (); - help += " -"; - help += o.name; + size_t initial_len = help.length (); + help += " -"; + help += option.name; - append_val_type_str (help, o, initial_len); + append_val_type_str (help, option, initial_len); + help += "\n"; + append_indented_doc (option.set_doc, help); + if (option.help_doc != nullptr) + { help += "\n"; - append_indented_doc (o.set_doc, help); - if (o.help_doc != nullptr) - { - help += "\n"; - append_indented_doc (o.help_doc, help); - } + append_indented_doc (option.help_doc, help); } } -- 2.56.0