From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OaspGYC4vWrmKyEAWB0awg (envelope-from ) for ; Wed, 30 Sep 2026 21:33:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1790818432; bh=atnZt/2ekN86Q5TfkX6whiTydQYp5COrk0PdbUlmu6E=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=djR5UzPRFQ4zlLSMNLWdTNlawDckXdDCrQoALrAsamrNtlW+UU1xQ69zxbAjSo//z uFDN236eO9IRmND8NLz9v7WGz4wQDKVT8PAYCw788A7DS2Ews9BYuvcxwtsxfHz0I4 G/uE6aXu5mt8cBJd786Cw9tiEsYSDqx6p5AdP5ao= Received: by simark.ca (Postfix, from userid 112) id 4DA221E051; Wed, 30 Sep 2026 21:33:52 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=l7q9yGzT; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 DC1F41E01F for ; Wed, 30 Sep 2026 21:33:49 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 515B34BB58B2 for ; Thu, 1 Oct 2026 01:33:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 515B34BB58B2 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=l7q9yGzT Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id B7B0B4BB3BE7 for ; Thu, 1 Oct 2026 01:33:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B7B0B4BB3BE7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B7B0B4BB3BE7 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790818402; cv=none; b=MQtfi1PsJxRbticRzizXN38V9Bbm6EFebV/0q3lD23w6dSSoIPHkkk7VRqVHQP5b9n/OXdfrVjg7DR1o4Vu6bNc6OWAVgj2sJiGTz8naR8aO7M1r6rfGs9QeJJGThTAHzPHwkhYAxR4+cOxFKGSY9kva0KHe9ZYYSe1nNIwHDGQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790818402; c=relaxed/simple; bh=atnZt/2ekN86Q5TfkX6whiTydQYp5COrk0PdbUlmu6E=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=UTOw8EOHfpC7WJuflidSF6Sdj3BeuKqzDPZohST5COcuhYZGu3Gb439eCJQISHfkD+/aNS4XIofiOXV6mpgbfdnqSSmC0aY+gEJJ/Tjjp4+rGfb07fH4fu0jejE4HHJyxxp7umq1LZlQb2ahTpALOMhbzMqvohLC9d3fTY4Ves4= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=l7q9yGzT DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B7B0B4BB3BE7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1790818400; bh=atnZt/2ekN86Q5TfkX6whiTydQYp5COrk0PdbUlmu6E=; h=Date:Subject:To:References:From:In-Reply-To:From; b=l7q9yGzTQBABlKQ1EMSsGE3IF4AqAbxJ8VnL+rH4PJkrcpRKQEm9X5Nc4huWgk1bZ HNU9mzd4Ca21svlhbLCaBJgD7jJ61cHi/pZiCtYFmZmpdyDTt4DvoR4CdmaGUYHWpl 8I1xjAP+cW7hkMOypEy/YYPjOquacajhzRRFlW50= Received: by simark.ca (Postfix) id 2DA781E01F; Wed, 30 Sep 2026 21:33:20 -0400 (EDT) Message-ID: Date: Wed, 30 Sep 2026 21:33:19 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 8/9] gdb: pass result containers by reference in global_symbol_searcher To: "Rohr, Stephan" , Simon Marchi , "gdb-patches@sourceware.org" References: <20260929194119.155169-1-simon.marchi@efficios.com> <20260929194119.155169-9-simon.marchi@efficios.com> Content-Language: en-US From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 On 2026-09-30 09:58, Rohr, Stephan wrote: > > >> -----Original Message----- >> From: Simon Marchi >> Sent: Tuesday, 29 September 2026 21:39 >> To: gdb-patches@sourceware.org >> Cc: Simon Marchi >> Subject: [PATCH 8/9] gdb: pass result containers by reference in >> global_symbol_searcher >> >> add_matching_symbols and add_matching_msymbols take the container to >> add results to as a pointer, but it can never be nullptr. Pass it by >> reference instead. >> >> Change-Id: I65d8e14f2f3152d83afbe3b348fc91a8817b87fa >> --- >> gdb/symtab.c | 17 ++++++++--------- >> gdb/symtab.h | 4 ++-- >> 2 files changed, 10 insertions(+), 11 deletions(-) >> >> diff --git a/gdb/symtab.c b/gdb/symtab.c >> index 79e43eafde18..10a794004d33 100644 >> --- a/gdb/symtab.c >> +++ b/gdb/symtab.c >> @@ -4899,7 +4899,7 @@ global_symbol_searcher::add_matching_symbols >> (objfile *objfile, >> const std::optional &name_regex, >> const std::optional &type_regex, >> - std::set *result_set) const >> + std::set &result_set) const > > Just a general question: does it make sense to keep "objfile" as pointer > or could this also be converted to reference for consistency? It could be converted to a reference as well, I'll do it. >> diff --git a/gdb/symtab.h b/gdb/symtab.h >> index 5dd0475e4491..e382b64b427c 100644 >> --- a/gdb/symtab.h >> +++ b/gdb/symtab.h >> @@ -2705,7 +2705,7 @@ class global_symbol_searcher >> bool add_matching_symbols (objfile *objfile, >> const std::optional &name_regex, >> const std::optional &type_regex, >> - std::set *result_set) const; >> + std::set &result_set) const; >> > > Nit: The comment in symtab.h mentions "RESULTS_SET", but it should be > "RESULT_SET". This is not the correct patch to address this, I just noticed now. Fixed that too. Thanks, Simon