Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH 1/2] Use bool in continue_1
Date: Wed, 13 May 2026 11:32:58 -0600	[thread overview]
Message-ID: <20260513-remove-for-each-v1-1-8793bd79f781@adacore.com> (raw)
In-Reply-To: <20260513-remove-for-each-v1-0-8793bd79f781@adacore.com>

This changes continue_1 to use 'bool' and renames its parameter.  The
renaming is important to avoid shadowing the 'all_threads' function.
---
 gdb/infcmd.c     | 4 ++--
 gdb/inferior.h   | 2 +-
 gdb/mi/mi-main.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index f3f15c9ae1d..d4cd2c7d5cd 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -746,12 +746,12 @@ ensure_not_running (void)
 }
 
 void
-continue_1 (int all_threads)
+continue_1 (bool all_threads_p)
 {
   ERROR_NO_INFERIOR;
   ensure_not_tfind_mode ();
 
-  if (non_stop && all_threads)
+  if (non_stop && all_threads_p)
     {
       /* Don't error out if the current thread is running, because
 	 there may be other stopped threads.  */
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 9c031035a23..d141aacba8a 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -225,7 +225,7 @@ extern void attach_command (const char *, int);
 
 extern void registers_info (const char *, bool);
 
-extern void continue_1 (int all_threads);
+extern void continue_1 (bool all_threads_p);
 
 extern void interrupt_target_1 (bool all_threads);
 
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 52e642e1464..53821e69042 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -286,7 +286,7 @@ exec_continue (const char *const *argv, int argc)
 	}
       else
 	{
-	  continue_1 (0);
+	  continue_1 (false);
 	}
     }
   else
@@ -296,7 +296,7 @@ exec_continue (const char *const *argv, int argc)
       if (current_context->all)
 	{
 	  sched_multi = 1;
-	  continue_1 (0);
+	  continue_1 (false);
 	}
       else
 	{
@@ -304,7 +304,7 @@ exec_continue (const char *const *argv, int argc)
 	     either all threads, or one thread, depending on the
 	     'scheduler-locking' variable.  Let's continue to do the
 	     same.  */
-	  continue_1 (1);
+	  continue_1 (true);
 	}
     }
 }

-- 
2.54.0


  reply	other threads:[~2026-05-13 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 17:32 [PATCH 0/2] Remove for_each_thread Tom Tromey
2026-05-13 17:32 ` Tom Tromey [this message]
2026-05-14 14:00   ` [PATCH 1/2] Use bool in continue_1 Simon Marchi
2026-05-13 17:32 ` [PATCH 2/2] Remove for_each_thread Tom Tromey
2026-05-14 14:13   ` Simon Marchi
2026-05-14 17:48     ` Tom Tromey
2026-07-22 18:21 ` [PATCH 0/2] " Tom Tromey

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=20260513-remove-for-each-v1-1-8793bd79f781@adacore.com \
    --to=tromey@adacore.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