Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] gdb: share some thread proceed related code between CLI and MI
Date: Fri, 7 Aug 2026 12:14:23 +0200	[thread overview]
Message-ID: <c90dcb58-d602-4845-8991-963702e3cc78@suse.de> (raw)
In-Reply-To: <55e17e264f17f47680100684c9aa7bd9b88e377c.1786049312.git.aburgess@redhat.com>

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:
...
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


  parent reply	other threads:[~2026-08-07 10:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 20:53 [PATCH 0/2] Cleanup and bug fix related to thread iteration and proceed calls Andrew Burgess
2026-08-06 20:54 ` [PATCH 1/2] gdb: use inferior::threads instead of all_threads and a PID filter Andrew Burgess
2026-08-07  7:59   ` Tom de Vries
2026-08-06 20:54 ` [PATCH 2/2] gdb: share some thread proceed related code between CLI and MI Andrew Burgess
2026-08-07  9:20   ` Tom de Vries
2026-08-07 15:40     ` Andrew Burgess
2026-08-07 10:14   ` Tom de Vries [this message]
2026-08-07 15:31     ` Andrew Burgess
2026-08-07 16:52       ` Tom de Vries
2026-08-24 18:18         ` Andrew Burgess

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c90dcb58-d602-4845-8991-963702e3cc78@suse.de \
    --to=tdevries@suse.de \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox