[PATCH v2 24/47] Windows gdb: Enable "set scheduler-locking on"

Pedro Alves
2025-05-19T13:31:43Z

Surprisingly (to me), enabling scheduler locking on Windows currently
fails:

(gdb)
set scheduler-locking on
Target 'native' cannot support this command.

The backend itself does support scheduler-locking. This patch
implements windows_nat_target::get_thread_control_capabilities so that
the core knows schedlocking works for this target.

Approved-By: Tom Tromey <tom@tromey.com>
Change-Id: Ie762d3768fd70e4ac398c8bcc03c3213bfa26a6a
---
gdb/windows-nat.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 1e518f46c49..1197c2f8fe1 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -254,6 +254,9 @@ struct windows_nat_target final : public x86_nat_target<inf_child_target>

void close () override;

+ thread_control_capabilities get_thread_control_capabilities () override
+ { return tc_schedlock; }
+
void attach (const char *, int) override;

bool attach_no_wait () override
--
2.49.0