Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/3] gdb: boolify thread_info's 'stop_requested' field
Date: Thu, 28 Mar 2024 18:35:36 +0100	[thread overview]
Message-ID: <20240328173537.2679010-2-tankut.baris.aktemur@intel.com> (raw)
In-Reply-To: <20240328173537.2679010-1-tankut.baris.aktemur@intel.com>

Boolify the field.  The 'set_stop_requested' function was already
taking a bool parameter, whose value is assigned to the field.
---
 gdb/gdbthread.h | 2 +-
 gdb/infcmd.c    | 2 +-
 gdb/infrun.c    | 8 ++++----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 11c553a99ca..02ff50afcd9 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -530,7 +530,7 @@ class thread_info : public intrusive_list_node<thread_info>,
   struct target_waitstatus pending_follow;
 
   /* True if this thread has been explicitly requested to stop.  */
-  int stop_requested = 0;
+  bool stop_requested = false;
 
   /* The initiating frame of a nexting operation, used for deciding
      which exceptions to intercept.  If it is null_frame_id no
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index ac41ebf11b4..68ecdb9feba 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -2879,7 +2879,7 @@ stop_current_target_threads_ns (ptid_t ptid)
      all-stop mode, we will only get one stop event --- it's undefined
      which thread will report the event.  */
   set_stop_requested (current_inferior ()->process_target (),
-		      ptid, 1);
+		      ptid, true);
 }
 
 /* See inferior.h.  */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index bbb98f6dcdb..c0ebc95a061 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1284,7 +1284,7 @@ follow_exec (ptid_t ptid, const char *exec_file_target)
   /* The user may have had the main thread held stopped in the
      previous image (e.g., schedlock on, or non-stop).  Release
      it now.  */
-  th->stop_requested = 0;
+  th->stop_requested = false;
 
   update_breakpoints_after_exec ();
 
@@ -3079,7 +3079,7 @@ clear_proceed_status_thread (struct thread_info *tp)
   tp->control.step_stack_frame_id = null_frame_id;
   tp->control.step_over_calls = STEP_OVER_UNDEBUGGABLE;
   tp->control.step_start_function = nullptr;
-  tp->stop_requested = 0;
+  tp->stop_requested = false;
 
   tp->control.stop_step = 0;
 
@@ -5455,7 +5455,7 @@ handle_one (const wait_one_event &event)
       if (t == nullptr)
 	t = add_thread (event.target, event.ptid);
 
-      t->stop_requested = 0;
+      t->stop_requested = false;
       t->set_executing (false);
       t->set_resumed (false);
       t->control.may_range_step = 0;
@@ -5695,7 +5695,7 @@ stop_all_threads (const char *reason, inferior *inf)
 		      infrun_debug_printf ("  %s executing, need stop",
 					   t->ptid.to_string ().c_str ());
 		      target_stop (t->ptid);
-		      t->stop_requested = 1;
+		      t->stop_requested = true;
 		    }
 		  else
 		    {
-- 
2.34.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


  reply	other threads:[~2024-03-28 17:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 17:35 [PATCH 1/3] gdb: print 'stop_requested' in infrun_debug_show_threads Tankut Baris Aktemur
2024-03-28 17:35 ` Tankut Baris Aktemur [this message]
2024-03-28 17:35 ` [PATCH 3/3] gdb: avoid redundant calls to target_stop during attach Tankut Baris Aktemur

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=20240328173537.2679010-2-tankut.baris.aktemur@intel.com \
    --to=tankut.baris.aktemur@intel.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