From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4UXVCdjCvWqKVCEAWB0awg (envelope-from ) for ; Wed, 30 Sep 2026 22:18:00 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=GBD9B8gr; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 252DE1E04E; Wed, 30 Sep 2026 22:18:00 -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 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 4BDF91E04E for ; Wed, 30 Sep 2026 22:17:59 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB5424BB58FA for ; Thu, 1 Oct 2026 02:17:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB5424BB58FA Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=GBD9B8gr Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 3055D4B9DB6E for ; Thu, 1 Oct 2026 02:17:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3055D4B9DB6E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3055D4B9DB6E Authentication-Results: sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790821030; cv=none; b=rBmaVi34ln0YB8Xzce2NiWb4KBlUKuhb66GzCxxbUY47sLE9N1Lo/DF5w9KQ9/kUSv84dIJXitnuCWqYgpKhMl4IWIKVOtx/HjieI6x6ahSBycU828CKoM+f9JusoWnhorQZtiHa0SBtVbXuog176EXecxuvBQdOYEfkjO24K/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790821030; c=relaxed/simple; bh=ScBx/u+hknhLn4Wvc2ycd4LZqqmimQB82o5CXsDUqMc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=PgFaA/wuY+Z/Qfte/QezB/AW5fAZqL9zPtQKTp7ja09gb+mBouzyoRbbVdY29N0tEHfc7qqHmkm1fScJiR399c1/V4bqp8+82ygLtmQ0K0zefah21aYNaDq38nqAkIm6XmhdpozYiPwvRKZIR4YAcnHIWOCKc1HeZfZkp33chaY= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=GBD9B8gr DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3055D4B9DB6E Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 6912H16V169617 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2026 22:17:06 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 6912H16V169617 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1790821026; bh=U+k3Lpea3Pk//qPxxUzCzKc7yXm7cYIQwrHJnOuh3VE=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=GBD9B8grWAPNoWcUg75EaXvEjt0eHqdbVGOLmzVOpsL1vSNDeyn+r0Avh5UR8ouER 3pCzHTGP978LGEJq0BuTxG9i7ynHoUy2eVlc6PWsFLfeP79mfu7bylffN7mhs4bQNz YMdAgokshwFjz6JvRQuAL+Her0NveDYH6xjEiLU6SaMACgr6oYybpIl8AwPtsyZt1L ZQs7rpxlIiPvUAZxE3R9xIuehAp+mefipy2dRO13buLOqro+dmB+grK0GvbbOraS7I DWELXSxuJz3cpzTj/kqOiGbiaL5hAda7lFxzz6gJpPOOpEEB7NkTPr/QUajK4hXVB/ X0XNgARDgn4rw== Received: by simark.ca (Postfix) id D37631E0C2; Wed, 30 Sep 2026 22:09:56 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi , "Rohr, Stephan" Subject: [PATCH v2 07/11] gdb: make global_symbol_searcher::is_suitable_msymbol non-static Date: Wed, 30 Sep 2026 22:09:24 -0400 Message-ID: <20261001020952.698419-8-simon.marchi@polymtl.ca> 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-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 1 Oct 2026 02:17:01 +0000 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 From: Simon Marchi 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 Reviewed-By: Rohr, Stephan --- 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 6cc85a7eacc5..a436e9011626 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -4720,7 +4720,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 ()) { @@ -4728,12 +4728,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; } @@ -4791,7 +4791,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, @@ -4909,7 +4909,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 de8cf40974e0..7afefaf3a322 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2715,9 +2715,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