From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Kcg5JuwU4mkqQx4AWB0awg (envelope-from ) for ; Fri, 17 Apr 2026 07:09:32 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=X1YAxom+; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 98FFB1E0C3; Fri, 17 Apr 2026 07:09:32 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,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=unavailable 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 D353F1E0B1 for ; Fri, 17 Apr 2026 07:09:31 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id D16324C900CA for ; Fri, 17 Apr 2026 11:09:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D16324C900CA Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=X1YAxom+ Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id D581A4BA2E35 for ; Fri, 17 Apr 2026 11:09:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D581A4BA2E35 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D581A4BA2E35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776424146; cv=none; b=R1+y4RD7eozkAp7q8Zms0gTs7oiwJhqYi/ioB2bc/1gFbrUsq6KQ3xpzYOl2WK9sOXOBRT8Wb/XnGGTCjCF2GQJWdsL1jpfgcSFSkbXST7TDFclm+FrON/Yg+ZEAYuzB1d8jbRBlljnkPh6AEt79hpoB/TF1Qskj3JBfgMggqBk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776424146; c=relaxed/simple; bh=+zjjeVSP/ceyucqOpq5ukL54TRAEMD4y31WNGxqPDTE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=jccS4HeHwl2gsHPSoD9iHYpQ9c+urwnE8sPxFGakq1UKf0HM7MCkXNf4AnrG/+vyQbXhd8gBLhjj/P2VTNBZIVfl/VBgmSL0AJqvtKTAf1BeCYrUihOzlGtXskACSONWB9rIbVj+WffJT8uO9rxPpSOkYeZN9/wtedl/CquGobo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D581A4BA2E35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776424145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xhrZ4INTjrNZw4gGv0mnOT8uf1jR+h2IYxgz4Mxf1P4=; b=X1YAxom+/PnBCKAWdis5i3UnOI9R3vh4j+6EDpXkbOJZ2qKBqaXIIAqY23QuaBowZBOcUF J92sQUPO4ZlpvcNmeA6rVDMVusyg/9OGn/cuN48QJUIv54nMTqfYc6rhJA+pGBbhoiuyXF H6CxcMZM1NrOfihDCyOtSp50YztBv6M= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-450-BRWL-vWXOMWy-Yn3iBRivw-1; Fri, 17 Apr 2026 07:09:04 -0400 X-MC-Unique: BRWL-vWXOMWy-Yn3iBRivw-1 X-Mimecast-MFC-AGG-ID: BRWL-vWXOMWy-Yn3iBRivw_1776424143 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-43cfedb10a8so382303f8f.1 for ; Fri, 17 Apr 2026 04:09:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776424142; x=1777028942; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xhrZ4INTjrNZw4gGv0mnOT8uf1jR+h2IYxgz4Mxf1P4=; b=bEVkfat0PKR/N+OukGnN7I/23TNDB8mmaH4X2Les1GvF8wpFIw+wtoF8pHBm4JsTA7 5KSN4APprfz0ha0YrfSgcMqQTVmiqr53/l0/VYEOOIJsmAAfdOwMIHJu63KjLUF4YnpV lu8HEDsQ/m5pA6Pn/3AhdbCib7KKebvSzDeyiUP98o7h9s0H6fzaW0ul8wdOQL+I3k4A EzfmZ+tSd/Iidwxg8mUWDkgFnKsx+M4tqGW3xSb3JC+JGEScR1g+JHMTSPHR50M04DkK GsMhGtJT+BqEX6+cQzY7GFD/MbMVTni1/2wf/CiVZprJNYx5T9vhPf/DKhj16flPB8aK E9tA== X-Forwarded-Encrypted: i=1; AFNElJ8857cozHno9pn4ATEoqx53jD/l9F9WYcCxdbf6KVN81/xmICj8pKYRYCQU3k8UBYoIXdpOwXf6ZNWXsA==@sourceware.org X-Gm-Message-State: AOJu0YyueaCVDLSnWatXjwTrdYZfWQg6plMW95xuvF6syeiydaMqUsSM vH1U/WRaIWokhkRyfZZZmaRGdouyAYKARrvSlYzUj5pgx1fwhZlc4iyOcEFn1fZL0dL5iOSqhNi YFtJcPIvqOsZxwJ+njblZ8s1PsyUSsMzpZrDX3Q3FMQWMlqd9Ei5By3qAqAN9QuvIavrezIo= X-Gm-Gg: AeBDietuUu8ePkBkw0rTKbe61dmF+JbboChBWgmJ8Glv9rmJ20jb2n3NiTLwJr83hWQ XHvQZ8S960hJcePqJCyIBWKCKxbk+JRNe1EY5VrEDtnO61xueuxwGGGB55GbBRgFdiPxw+zpILR ycIp31Ew9ScBFIj5mCFLiYlElmc1WilVw0+1xqWoAZbjT1sJr8PFa4eSG7JikjZmHzFNrYHp7xZ HypPgO/9p9C+nlZn7I057mp8X8kh4MuLSYTpt+Ao0dAgKsbXWE7uMyjSgawrWtC0JSJH1XPlD7D Yx76kkSbAHfVB7vJbgRz4AjnMVjle+ZIEb/43jNPQF2Xup9BPab4ZiUUFKrNW06lJG5r8/faD0r sRCd4UH8eVUvEWT01csHFNYObT7o= X-Received: by 2002:a05:600c:34c3:b0:485:41c4:e2e4 with SMTP id 5b1f17b1804b1-488fb792dd0mr35241245e9.23.1776424142506; Fri, 17 Apr 2026 04:09:02 -0700 (PDT) X-Received: by 2002:a05:600c:34c3:b0:485:41c4:e2e4 with SMTP id 5b1f17b1804b1-488fb792dd0mr35240625e9.23.1776424142027; Fri, 17 Apr 2026 04:09:02 -0700 (PDT) Received: from localhost ([31.111.84.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fc16f8c3sm34213165e9.2.2026.04.17.04.09.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 04:09:01 -0700 (PDT) From: Andrew Burgess To: Simon Marchi , gdb-patches@sourceware.org Cc: Simon Marchi Subject: Re: [PATCH 04/11] gdb, gdbserver: make iterate_over_lwps_ftype a function_view In-Reply-To: <20260416202408.422441-5-simon.marchi@efficios.com> References: <20260416202408.422441-1-simon.marchi@efficios.com> <20260416202408.422441-5-simon.marchi@efficios.com> Date: Fri, 17 Apr 2026 12:09:01 +0100 Message-ID: <87tst9etde.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: B859J13mqG6Glh_1Yy0cR39fDgEnC8qbwx1zir6I0nw_1776424143 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 Simon Marchi writes: > 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/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. */ While looking at this change, I noticed that the comment for this declaration is out of date. This is NOT your fault, it became out of date a while back. But would you mind fixing the comment as you're also touching the declaration? > > -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. */ > Approved-By: Andrew Burgess Thanks, Andrew