]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: boolify thread_info's 'stop_requested' field
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 9 Jan 2025 11:54:25 +0000 (12:54 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Thu, 9 Jan 2025 11:54:25 +0000 (12:54 +0100)
Boolify the field.  The 'set_stop_requested' function was already
taking a bool parameter, whose value is assigned to the field.

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/gdbthread.h
gdb/infcmd.c
gdb/infrun.c

index 174488c083e6f2aeb70f268baaf3b24023565bd8..ee62153551f37d177a43739921ea8f531866a19a 100644 (file)
@@ -533,7 +533,7 @@ public:
   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
index 9fcbadbe0232d8e2a6dc7c545adb1dad39a5d446..b6b21a46b3d457ca45973bc1ddf0738804b52bcb 100644 (file)
@@ -2880,7 +2880,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.  */
index 8a10119487c4d58660970f27a08acd69ce7acd03..4687ee6edb39224100c35a8b770a3a3731a38441 100644 (file)
@@ -1287,7 +1287,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 ();
 
@@ -3091,7 +3091,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;
 
@@ -5497,7 +5497,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;
@@ -5737,7 +5737,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
                    {