aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/aarch64-windows-nat.c1
-rw-r--r--gdb/windows-nat.c11
-rw-r--r--gdb/x86-windows-nat.c1
-rw-r--r--gdbserver/win32-low.cc5
4 files changed, 10 insertions, 8 deletions
diff --git a/gdb/aarch64-windows-nat.c b/gdb/aarch64-windows-nat.c
index d43ee6f13fe..871531bb93a 100644
--- a/gdb/aarch64-windows-nat.c
+++ b/gdb/aarch64-windows-nat.c
@@ -185,7 +185,6 @@ aarch64_windows_nat_target::fill_thread_context (windows_thread_info *th)
if (context->ContextFlags == 0)
{
- th->suspend ();
context->ContextFlags = WindowsContext<decltype(context)>::all;
CHECK (get_thread_context (th->h, context));
}
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 30b07221b62..468f451595d 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -710,12 +710,6 @@ windows_nat_target::windows_continue (DWORD continue_status, int id,
th->resume ();
}
- else
- {
- /* When single-stepping a specific thread, other threads must
- be suspended. */
- th->suspend ();
- }
std::optional<unsigned> err;
do_synchronously ([&] ()
@@ -1191,6 +1185,11 @@ windows_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
th->stopped_at_software_breakpoint = true;
th->pc_adjusted = false;
}
+
+ /* All-stop, suspend all threads until they are
+ explicitly resumed. */
+ for (auto &thr : windows_process.thread_list)
+ thr->suspend ();
}
return result;
diff --git a/gdb/x86-windows-nat.c b/gdb/x86-windows-nat.c
index 5b0f7066fba..baa6b969e99 100644
--- a/gdb/x86-windows-nat.c
+++ b/gdb/x86-windows-nat.c
@@ -111,7 +111,6 @@ x86_windows_nat_target::fill_thread_context (windows_thread_info *th)
{
if (context->ContextFlags == 0)
{
- th->suspend ();
context->ContextFlags = WindowsContext<decltype(context)>::all;
CHECK (get_thread_context (th->h, context));
}
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
index bf55183f705..d78de17ff19 100644
--- a/gdbserver/win32-low.cc
+++ b/gdbserver/win32-low.cc
@@ -1188,6 +1188,11 @@ win32_process_target::wait (ptid_t ptid, target_waitstatus *ourstatus,
OUTMSG2 (("Child Stopped with signal = %d \n",
ourstatus->sig ()));
maybe_adjust_pc ();
+
+ /* All-stop, suspend all threads until they are explicitly
+ resumed. */
+ for_each_thread (suspend_one_thread);
+
return debug_event_ptid (&windows_process.current_event);
}
default: