]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Windows gdb: Always non-stop (default to "maint set target-non-stop on")
authorPedro Alves <pedro@palves.net>
Fri, 16 May 2025 20:11:08 +0000 (21:11 +0100)
committerPedro Alves <pedro@palves.net>
Mon, 9 Jun 2025 17:09:18 +0000 (18:09 +0100)
Since having the target backend work in non-stop mode adds features
compared to old all-stop mode (signal/exception passing/suppression is
truly per-thread), this switches the backend to do
all-stop-on-top-of-non-stop, by having
windows_nat_target::always_non_stop_p return true if non-stop mode is
possible.

To be clear, this just changes how the backend works in coordination
with infrun.  The user-visible mode default mode is still all-stop.

The difference is that infrun is responsible for stopping all threads
when needed, instead of the backend (actually the kernel) always doing
that before reporting an event to infrun.

Change-Id: I83d23dbb1edc7692d5d8b37f5b9e0264c74d4940

gdb/windows-nat.c

index fa3c5688bfb13210012dfa93c7c912239d856b24..827f342f7fb2c04c118c94b79f44a3130bcca2b8 100644 (file)
@@ -569,6 +569,7 @@ struct windows_nat_target final : public x86_nat_target<inf_child_target>
   }
 
   bool supports_non_stop () override;
+  bool always_non_stop_p () override;
 
   void async (bool enable) override;
 
@@ -4122,6 +4123,15 @@ windows_nat_target::supports_non_stop ()
   return dbg_reply_later_available ();
 }
 
+/* Implementation of the target_ops::always_non_stop_p method.  */
+
+bool
+windows_nat_target::always_non_stop_p ()
+{
+  /* If we can do non-stop, prefer it.  */
+  return supports_non_stop ();
+}
+
 void _initialize_windows_nat ();
 void
 _initialize_windows_nat ()