From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id y6btJVv6dWo7NhEAWB0awg (envelope-from ) for ; Fri, 07 Aug 2026 11:31:39 -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=KnNKNs59; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8AE791E09B; Fri, 07 Aug 2026 11:31:39 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.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 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 A74AA1E09B for ; Fri, 07 Aug 2026 11:31:38 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE8074B9DB4B for ; Fri, 7 Aug 2026 15:31:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE8074B9DB4B 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=KnNKNs59 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 85BC64BB3BE5 for ; Fri, 7 Aug 2026 15:31:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 85BC64BB3BE5 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 85BC64BB3BE5 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786116671; cv=none; b=HZT7OYGaKx/5gRQ4flr+Ev3MrFgc9u9t77D9RWU0t1CaDL3oA+FWTdeODRDM7mf1ETdvlLnmeIpPZQaxhSo+26c282oAnQBywPH7jcNenOQslm9M/oE10p5uu1/rUmt2LD5ccr+RcgrgAZIjWDYS3Xepg8/AiupSgUZ24b++gxw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786116671; c=relaxed/simple; bh=y1D42uwKcjFalPB8psDRKDgpOr2fdmuFiVpc8YwlzMM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=W+oEn7y2jfZ/d1h+XgmDvTfBTlpFQojzu0C8pp8V7v5TRXiy7Ll1HPZqe9tFhUUlBAZEPz7zcTGl0Go7+h6khUnWaJJwzOXPZ7NZ8VWc9iHOsrJb/TEWblBy6eq1JXPjg4Qd4yrl2yNt047nBbEGnS5+XO3cf6HMmpjcqBgF5Ww= ARC-Authentication-Results: i=1; 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=KnNKNs59 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85BC64BB3BE5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1786116671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ubC/7aoJoLNibkX4OrdT18guc7MMm5sB8XK6BsoRIP0=; b=KnNKNs59D/aw89lvdMy/79LzC7++fCKC9E0prS7X85cwaIXp5ZxBP2XwIobiOU4vuoFoOt ul+zQEi4oQXkEDJv4ADzTIQPX1kvR5ONn4paan3Y1T6pdrM3YcDsseWluORWGWOBk3Go+Y hJhhyK7oJJ7aNLXoRQOmfptes9rFVHE= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-2YFfAk7xMKejeaPqn3X2VQ-1; Fri, 07 Aug 2026 11:31:10 -0400 X-MC-Unique: 2YFfAk7xMKejeaPqn3X2VQ-1 X-Mimecast-MFC-AGG-ID: 2YFfAk7xMKejeaPqn3X2VQ_1786116669 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-475e540a0ffso2167024f8f.3 for ; Fri, 07 Aug 2026 08:31:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786116669; x=1786721469; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ubC/7aoJoLNibkX4OrdT18guc7MMm5sB8XK6BsoRIP0=; b=Q9tTs6xTG77IJGcesslWzFD6cy8At7/BvIUbxgBqxwAGvl6rEeCflkLbH3B5xCBuD1 Itmaf1qk8/7uFL+dtgNQA306d4hHlMsRs9OI0yh1HhJUAq1KQdasNv5JLVOrO8fJNGt4 L8v+DNsF3M62W36kI5sdeDc4LZ994GW03I+XK/GIoTix2Auzpk6BniD09yUdSjXnY3CC I/s/CrswSxf8prJo/lHjbz7uDLaB+KoufbXi0KjU+fEbH7tljHnC2MTSqlYSXvRDcUgj BseOwkwhoqDzo/AbayF1LmqdGo4b8gVfBBJ0OaodiuMulp8lASDIvmMd5WGIlv4lWwhZ T52g== X-Forwarded-Encrypted: i=1; AHgh+RrIUzaI+AkmX0U0NQatrgOUE2OLkGaE4no12h97ps9oxD7SJi3dDPwD2DOOBjvpLIhdXZfFZAaGZfl8zQ==@sourceware.org X-Gm-Message-State: AOJu0Yy32qwMDHULW0dldIMD+JYkUMd66ECJOQpZjyM9W33CljonlYZc /by17AaQbueDxgv5mevnsnVn5KwZOfoH3rbXrJ87bGJs8pqxh4qlPVbbeIpbluVELyNZD/5+DQQ 5sTu50wx0mgJdNt+ScUZgYv+EKhLh925gcnGsYcoP1aRBaMrvIbdCQ61hhwp6P906eIusCV8= X-Gm-Gg: AR+sD10k/XBhrI4nTqkm/BXwBvJ3wNQEo8uHg803Mb7DXABpmmKAkaAPIOMWwrX1KfJ 3yWo0FSK3jY0TAaw5ir+LMsJixfxLIaWJ0J4p6mlE1z1Hzk0nzwn7UXJ59rd8/fFemFyu/DRiZ1 sQeurSIpTdkL0iqAzEpWPkS/16EFnf7WMAdN3jqxsfWkDXV2tahHv6CV51PqIweDKEy+DjIsboc OVvxdJ5bZJa6npBE307Pwe19Ds+IZ0fhy7ZxUZ4T4mcAAI/w65Ck24NYuDQOhivXeJ6tuo84LS1 6ioQ6xzUGT3gaiSBTMCI7dUcpn4R9aYJetFmnfGDi+1jsDiPash1hlAWcU9oo2qQmnc536FLEU4 JoaRtnaxbKzBrkrdWDs6dmCqS X-Received: by 2002:adf:d006:0:b0:47f:9171:bca2 with SMTP id ffacd0b85a97d-47fec62a14amr29960358f8f.27.1786116668803; Fri, 07 Aug 2026 08:31:08 -0700 (PDT) X-Received: by 2002:adf:d006:0:b0:47f:9171:bca2 with SMTP id ffacd0b85a97d-47fec62a14amr29960285f8f.27.1786116668217; Fri, 07 Aug 2026 08:31:08 -0700 (PDT) Received: from localhost (227.114.208.46.dyn.plus.net. [46.208.114.227]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-480021457ebsm6583750f8f.6.2026.08.07.08.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2026 08:31:07 -0700 (PDT) From: Andrew Burgess To: Tom de Vries , gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] gdb: share some thread proceed related code between CLI and MI In-Reply-To: References: <55e17e264f17f47680100684c9aa7bd9b88e377c.1786049312.git.aburgess@redhat.com> Date: Fri, 07 Aug 2026 16:31:06 +0100 Message-ID: <87ik5mkkw5.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: J62oW0T1iirZESc7E0UT2B7hcXD1pMQSUSqUpTMo6MI_1786116669 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 Tom de Vries writes: > On 8/6/26 10:54 PM, Andrew Burgess wrote: >> + if (inf == nullptr) >> + proceed_all_threads (); >> + else >> + { >> + for (thread_info &thread : inf->threads ()) >> + proceed_one_thread (thread); >> } > > FWIW, also I wonder if it makes sense to fold this logic into > proceed_all_threads: I took a look through all the other proceed() calls and couldn't see anything else that might want to share this code, so my preference would be to leave things as I initially proposed. I like the simpler each function has one clear goal, rather than overloading proceed_all_threads with multiple meanings ("all threads", or "all threads in inferior"). Especially not a fan of default arguments for cases like this (or in general much). That said, if you consider this a blocker to merging this patch then I don't feel that strongly against it so would make the change to get this fix merged. Just let me know. Thanks, Andrew > ... > diff --git a/gdb/infcmd.c b/gdb/infcmd.c > index 23e93587874..d2301ddf093 100644 > --- a/gdb/infcmd.c > +++ b/gdb/infcmd.c > @@ -743,10 +743,18 @@ proceed_one_thread (thread_info &thread) > /* See inferior.h. */ > > void > -proceed_all_threads () > +proceed_all_threads (inferior *inf) > { > gdb_assert (non_stop); > > + if (inf != nullptr) > + { > + for (thread_info &thread : inf->threads ()) > + proceed_one_thread (thread); > + > + return; > + } > + > for (thread_info &thread : all_threads ()) > { > /* We go through all threads individually instead of compressing > diff --git a/gdb/inferior.h b/gdb/inferior.h > index 8255654d9b8..2067f60ab7d 100644 > --- a/gdb/inferior.h > +++ b/gdb/inferior.h > @@ -230,7 +230,7 @@ extern void continue_1 (bool all_threads_p); > /* For use only when non_stop is true. Proceed all threads in every > inferior. */ > > -extern void proceed_all_threads (); > +extern void proceed_all_threads (inferior *inf = nullptr); > > /* For use only when non_stop is true. If THREAD is stopped, and is in an > inferior that has_execution then switch to THREAD, clear its proceed > diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c > index e110b029e1e..1eb087b85db 100644 > --- a/gdb/mi/mi-main.c > +++ b/gdb/mi/mi-main.c > @@ -259,13 +259,7 @@ exec_continue (const char *const *argv, int argc) > if (!current_context->all) > inf = find_inferior_id (current_context->thread_group); > > - if (inf == nullptr) > - proceed_all_threads (); > - else > - { > - for (thread_info &thread : inf->threads ()) > - proceed_one_thread (thread); > - } > + proceed_all_threads (inf); > > disable_commit_resumed.reset_and_commit (); > } > ... > > Thanks, > - Tom