From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cc4wJ6AUvGoGjxkAWB0awg (envelope-from ) for ; Tue, 29 Sep 2026 15:42:24 -0400 Received: by simark.ca (Postfix, from userid 112) id 9D3541E051; Tue, 29 Sep 2026 15:42:24 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 448FA1E01F for ; Tue, 29 Sep 2026 15:42:24 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 674444B9DB5E for ; Tue, 29 Sep 2026 19:42:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 674444B9DB5E Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 4D85A4BA23D2 for ; Tue, 29 Sep 2026 19:41:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D85A4BA23D2 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4D85A4BA23D2 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=1790710884; cv=none; b=OSirWpKLBpQAXdZsgobLH3aSo0AKGfUxauIFybvLnacctXBhI4wbZYEwUHFs/ZZ7jCEam2eJ773U1CYFuyotI2OL+Mz7TdRzredNF4oJPkuXwWCilZUGSL5EMtRg2zobXgVwcuZZl+aETW/TR7NyjZGGYZrzEqEV0wXGNn35Ky8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790710884; c=relaxed/simple; bh=04zgocWA01YoKrad5uPtIHMEJqym0y15Vu2rO81i3rY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=Y6XMW3p5y4Npi1JfF+H3BLc0gr9FsPTkVhvYfzrVako2JfQJ2/bwRZlxZctewkmfjdyyQtkNj/QwdQ6ifAGGOrng/1inqlOGd51dTeKEtoM+iJ0aAK+X4vIIK097aDN28g8+denm9wCHlielzWmf4puH4kb5R0LDYphoT/hwvJY= ARC-Authentication-Results: i=1; sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D85A4BA23D2 Received: by simark.ca (Postfix) id 27D251E09E; Tue, 29 Sep 2026 15:41:23 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 5/9] gdb: make global_symbol_searcher::is_suitable_msymbol non-static Date: Tue, 29 Sep 2026 15:39:26 -0400 Message-ID: <20260929194119.155169-6-simon.marchi@efficios.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260929194119.155169-1-simon.marchi@efficios.com> References: <20260929194119.155169-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 is_suitable_msymbol is a static method taking the search kind as a parameter, but all callers pass m_kind. Make it a const non-static method that uses m_kind directly. Change-Id: I803e7cddbb317a8af35a82ea9e528c64f6326f31 --- gdb/symtab.c | 10 +++++----- gdb/symtab.h | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/gdb/symtab.c b/gdb/symtab.c index 2bb1cbf1b9ad..9ce6911666c6 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -4722,7 +4722,7 @@ to_search_flags (symbol_search_kind kind) bool global_symbol_searcher::is_suitable_msymbol - (symbol_search_kind kind, const minimal_symbol *msymbol) + (const minimal_symbol *msymbol) const { switch (msymbol->type ()) { @@ -4730,12 +4730,12 @@ global_symbol_searcher::is_suitable_msymbol case mst_bss: case mst_file_data: case mst_file_bss: - return kind == symbol_search_kind::VARIABLE; + return m_kind == symbol_search_kind::VARIABLE; case mst_text: case mst_file_text: case mst_solib_trampoline: case mst_text_gnu_ifunc: - return kind == symbol_search_kind::FUNCTION; + return m_kind == symbol_search_kind::FUNCTION; default: return false; } @@ -4793,7 +4793,7 @@ global_symbol_searcher::expand_symtabs if (msymbol->created_by_gdb) continue; - if (is_suitable_msymbol (m_kind, msymbol)) + if (is_suitable_msymbol (msymbol)) { if (!name_regex.has_value () || name_regex->exec (msymbol->natural_name (), 0, @@ -4911,7 +4911,7 @@ global_symbol_searcher::add_matching_msymbols if (msymbol->created_by_gdb) continue; - if (is_suitable_msymbol (m_kind, msymbol)) + if (is_suitable_msymbol (msymbol)) { if (!name_regex.has_value () || name_regex->exec (msymbol->natural_name (), 0, diff --git a/gdb/symtab.h b/gdb/symtab.h index 1675b126b19d..50d7000681df 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2703,9 +2703,8 @@ class global_symbol_searcher const std::optional &name_regex, std::vector *results) const; - /* Return true if MSYMBOL is of type KIND. */ - static bool is_suitable_msymbol (symbol_search_kind kind, - const minimal_symbol *msymbol); + /* Return true if MSYMBOL is of type M_KIND. */ + bool is_suitable_msymbol (const minimal_symbol *msymbol) const; }; /* When searching for Fortran symbols within modules (functions/variables) -- 2.55.0