From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YXa+KYpF4Wlo4xwAWB0awg (envelope-from ) for ; Thu, 16 Apr 2026 16:24:42 -0400 Received: by simark.ca (Postfix, from userid 112) id 643D51E0C3; Thu, 16 Apr 2026 16:24:42 -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 8D0201E0D1 for ; Thu, 16 Apr 2026 16:24:36 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 210494C900FE for ; Thu, 16 Apr 2026 20:24:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 210494C900FE Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id CCB274BB58BE for ; Thu, 16 Apr 2026 20:24:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CCB274BB58BE 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 CCB274BB58BE 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=1776371051; cv=none; b=cHllpMgfl6H+j+7LYxFkJsLIoMtqxEQnwqMsAyZN7lUMl3A/yIfvJkpHqCfS8/Nzvc/49r+2owOPdwA+CPeGUYbRI+pw5YLMPCpH+uOmVu9PenfdloqANPTblkHIodtLstvsDdBc/sJ35El+gq8Oi651KBRncm/P3qJURAhQK3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776371051; c=relaxed/simple; bh=5ozlC+KEQDcZv8a+D8YSBGx7uZfukPVZGUuE+nAPHjM=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=qHt7ZAjSKxqrAWU2fUx53R1l48bR4eDPCbdeo1TPx0pg+Zue4WYPzbpAzgkjvNWCnBJxzJ5CDvTPalbhHxnIBZuXMBK+gbKV4e3h6kEK4hCYbhEex5AHuhwVWQHAIUHdUH1NlTPucFN6Px8pYhnNb0yjApFgI0JpQzndJ+1qswk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCB274BB58BE Received: by simark.ca (Postfix) id 6F3591E0D1; Thu, 16 Apr 2026 16:24:10 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 04/11] gdb, gdbserver: make iterate_over_lwps_ftype a function_view Date: Thu, 16 Apr 2026 16:16:14 -0400 Message-ID: <20260416202408.422441-5-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 users of iterate_over_lwps_ftype use it within a function_view template. Integrate function_view to the type alias. Change-Id: I3eb23aa3dbc1889072a5d4654e861b00942d6c3f --- gdb/linux-nat.c | 5 ++--- gdb/nat/linux-nat.h | 7 +++---- gdbserver/linux-low.cc | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index f141ba19ea44..362ef5f1cb75 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -928,9 +928,8 @@ find_lwp_pid (ptid_t ptid) /* See nat/linux-nat.h. */ -struct lwp_info * -iterate_over_lwps (ptid_t filter, - gdb::function_view callback) +lwp_info * +iterate_over_lwps (ptid_t filter, iterate_over_lwps_ftype callback) { for (lwp_info &lp : all_lwps_safe ()) { diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h index 708990acc4d9..42c0467191fe 100644 --- a/gdb/nat/linux-nat.h +++ b/gdb/nat/linux-nat.h @@ -47,7 +47,7 @@ extern tribool have_ptrace_getregset; extern ptid_t current_lwp_ptid (void); /* Function type for the CALLBACK argument of iterate_over_lwps. */ -typedef int (iterate_over_lwps_ftype) (struct lwp_info *lwp); +using iterate_over_lwps_ftype = gdb::function_view; /* Iterate over all LWPs. Calls CALLBACK with its second argument set to DATA for every LWP in the list. If CALLBACK returns nonzero for @@ -55,9 +55,8 @@ typedef int (iterate_over_lwps_ftype) (struct lwp_info *lwp); LWP immediately. Otherwise return NULL. This function must be provided by the client. */ -extern struct lwp_info *iterate_over_lwps - (ptid_t filter, - gdb::function_view callback); +extern lwp_info *iterate_over_lwps (ptid_t filter, + iterate_over_lwps_ftype callback); /* Return the ptid of LWP. */ diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc index 0246217db86c..022e8415fda8 100644 --- a/gdbserver/linux-low.cc +++ b/gdbserver/linux-low.cc @@ -1768,9 +1768,8 @@ num_lwps (process_info *process) /* See nat/linux-nat.h. */ -struct lwp_info * -iterate_over_lwps (ptid_t filter, - gdb::function_view callback) +lwp_info * +iterate_over_lwps (ptid_t filter, iterate_over_lwps_ftype callback) { thread_info *thread = find_thread (filter, [&] (thread_info *thr_arg) { -- 2.53.0