]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Windows gdb: Factor code out of windows_nat_target::windows_continue
authorPedro Alves <pedro@palves.net>
Tue, 9 May 2023 19:34:50 +0000 (20:34 +0100)
committerPedro Alves <pedro@palves.net>
Fri, 24 Apr 2026 20:28:44 +0000 (21:28 +0100)
This factors some code out of windows_nat_target::windows_continue
into a new windows_continue_one function.  This will make the
following patch easier to read (as well as the resulting code itself).

Approved-By: Tom Tromey <tom@tromey.com>
Change-Id: I14a0386b1b8b03015e86273060af173b5130e375

gdb/windows-nat.c
gdb/windows-nat.h

index 170b837e9305f8fb9281b4869eb9671eab34dc8f..2ecb8a105c0a0232f8d8e5216ea7440cf352a9ac 100644 (file)
@@ -704,6 +704,15 @@ windows_per_inferior::handle_access_violation
   return false;
 }
 
+void
+windows_nat_target::continue_one_thread (windows_thread_info *th,
+                                        windows_continue_flags cont_flags)
+{
+  bool killed = (cont_flags & WCONT_KILLED) != 0;
+  thread_context_continue (th, killed);
+  th->resume ();
+}
+
 /* Resume thread specified by ID, or all artificially suspended
    threads, if we are continuing execution.  See description of
    windows_continue_flags for CONT_FLAGS.  */
@@ -725,12 +734,7 @@ windows_nat_target::windows_continue (DWORD continue_status, int id,
 
   for (auto &th : windows_process->thread_list)
     if (id == -1 || id == (int) th->tid)
-      {
-       bool killed = (cont_flags & WCONT_KILLED) != 0;
-       thread_context_continue (th.get (), killed);
-
-       th->resume ();
-      }
+      continue_one_thread (th.get (), cont_flags);
 
   continue_last_debug_event_main_thread
     (_("Failed to resume program execution"), continue_status,
index c4f3b2423b6426ce38a33ac82c33803c88516f0c..221ce58a887ede9a732f4b2d83091369a2174ed2 100644 (file)
@@ -243,6 +243,9 @@ private:
   void delete_thread (ptid_t ptid, DWORD exit_code, bool main_thread_p);
   DWORD fake_create_process ();
 
+  void continue_one_thread (windows_thread_info *th,
+                           windows_continue_flags cont_flags);
+
   BOOL windows_continue (DWORD continue_status, int id,
                         windows_continue_flags cont_flags = 0);