[19/34] Windows gdb: Enable "set scheduler-locking on"

Message ID 20240507234233.371123-20-pedro@palves.net
State New
Headers
Series Windows non-stop mode |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Pedro Alves May 7, 2024, 11:42 p.m. UTC
  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.

Change-Id: Ie762d3768fd70e4ac398c8bcc03c3213bfa26a6a
---
 gdb/windows-nat.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Tom Tromey May 8, 2024, 3:25 p.m. UTC | #1
>>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:

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

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

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

Oops.

This is ok once the earlier scheduler-locking patch goes in.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  

Patch

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index a34e230f66e..5ebf53e2816 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -261,6 +261,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