From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id URIxHCBG4Wkg5RwAWB0awg (envelope-from ) for ; Thu, 16 Apr 2026 16:27:12 -0400 Received: by simark.ca (Postfix, from userid 112) id 6DD3E1E0C3; Thu, 16 Apr 2026 16:27:12 -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.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 653521E04F for ; Thu, 16 Apr 2026 16:27:11 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 02CB84BB58DF for ; Thu, 16 Apr 2026 20:27:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02CB84BB58DF Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 6A0F64C900E6 for ; Thu, 16 Apr 2026 20:26:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A0F64C900E6 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 6A0F64C900E6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776371172; cv=none; b=dw0Y4cGjOInn57GqMN+urnv/EgQEw+uuwdc5D7snKUZ87nuo1CiqPlgRjQotIoUtPvidZrzxmx56nz//rVKHmrCx8VIMZQSwKQQ5aUymMc3QMdD3xmFQ7UhskR98nGxxqkwa4DxJqQ0NdGE5E8Xq7ew6XsrhI3UlYVoNPuEUc/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776371172; c=relaxed/simple; bh=qmsaEitsyMFT4t5ps+4YClwVEawWacJo4XDtY0pwtu4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=GanVRjDGZ9acOXLT3Pg+fYzBmab9Ohroz9BW6yPifo2uagQMLFZnGlZ0IBQpnvRE6QO0RaqfgnrFqZUM2lniNLLQEAaWDxcFZqbPF7Yaf1rz4nr5YvCiYEUqXz7yBvJF1Nv9rPjMT5fUdy75AUGjML3XOgz7UFpIUuI09vw9pRE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A0F64C900E6 Received: by simark.ca (Postfix) id 05D601E0C3; Thu, 16 Apr 2026 16:26:11 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 10/11] gdb: make symbol_found_callback_ftype a function_view Date: Thu, 16 Apr 2026 16:16:20 -0400 Message-ID: <20260416202408.422441-11-simon.marchi@efficios.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260416202408.422441-1-simon.marchi@efficios.com> References: <20260416202408.422441-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 From: Simon Marchi All uses of symbol_found_callback_ftype use it within a function_view, so factor out the function_view into the type alias. Change-Id: I24a1d2fc233aa5d593c9c68581a9912bfee3a348 --- gdb/ada-lang.c | 2 +- gdb/language.h | 2 +- gdb/linespec.c | 6 +++--- gdb/symtab.c | 2 +- gdb/symtab.h | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index f8ed4cc5e102..d388a301fa1a 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -13705,7 +13705,7 @@ class ada_language : public language_defn bool iterate_over_symbols (const struct block *block, const lookup_name_info &name, domain_search_flags domain, - gdb::function_view callback) const override + symbol_found_callback_ftype callback) const override { std::vector results = ada_lookup_symbol_list_worker (name, block, domain, 0); diff --git a/gdb/language.h b/gdb/language.h index da903eb702d2..0cc075f8a295 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -362,7 +362,7 @@ struct language_defn virtual bool iterate_over_symbols (const struct block *block, const lookup_name_info &name, domain_search_flags domain, - gdb::function_view callback) const + symbol_found_callback_ftype callback) const { return ::iterate_over_symbols (block, name, domain, callback); } diff --git a/gdb/linespec.c b/gdb/linespec.c index 0afe0c619a13..bfdd075ac825 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -363,7 +363,7 @@ struct linespec_parser static void iterate_over_file_blocks (struct symtab *symtab, const lookup_name_info &name, domain_search_flags domain, - gdb::function_view callback); + symbol_found_callback_ftype callback); static void initialize_defaults (struct symtab **default_symtab, int *default_line); @@ -1128,7 +1128,7 @@ iterate_over_all_matching_symtabs const lookup_name_info &lookup_name, const domain_search_flags domain, struct program_space *search_pspace, bool include_inline, - gdb::function_view callback) + symbol_found_callback_ftype callback) { for (struct program_space *pspace : program_spaces) { @@ -1196,7 +1196,7 @@ static void iterate_over_file_blocks (struct symtab *symtab, const lookup_name_info &name, domain_search_flags domain, - gdb::function_view callback) + symbol_found_callback_ftype callback) { const struct block *block; diff --git a/gdb/symtab.c b/gdb/symtab.c index fd841318387e..62d9ecf0ee0a 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2700,7 +2700,7 @@ bool iterate_over_symbols (const struct block *block, const lookup_name_info &name, const domain_search_flags domain, - gdb::function_view callback) + symbol_found_callback_ftype callback) { for (struct symbol *sym : block_iterator_range (block, &name)) { diff --git a/gdb/symtab.h b/gdb/symtab.h index 3936052706f1..3217d00914ce 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2811,7 +2811,7 @@ std::vector find_linetable_entries_for_symtab_line true to indicate that LA_ITERATE_OVER_SYMBOLS should continue iterating, or false to indicate that the iteration should end. */ -typedef bool (symbol_found_callback_ftype) (struct block_symbol *bsym); +using symbol_found_callback_ftype = gdb::function_view; /* Iterate over the symbols named NAME, matching DOMAIN, in BLOCK. @@ -2825,7 +2825,7 @@ typedef bool (symbol_found_callback_ftype) (struct block_symbol *bsym); bool iterate_over_symbols (const struct block *block, const lookup_name_info &name, const domain_search_flags domain, - gdb::function_view callback); + symbol_found_callback_ftype callback); /* Storage type used by demangle_for_lookup. demangle_for_lookup either returns a const char * pointer that points to either of the -- 2.53.0