Implement thread_name for gdbserver
authorTom Tromey <tromey@adacore.com>
Tue, 12 Apr 2022 20:27:13 +0000 (14:27 -0600)
committerTom Tromey <tromey@adacore.com>
Thu, 14 Apr 2022 18:12:34 +0000 (12:12 -0600)
This changes gdbserver to implement thread_name method.

gdbserver/win32-low.cc
gdbserver/win32-low.h

index 8fde3e95b2d6bde8abe0301d6db026fb1560cd69..16c13f32d7791920331e447fb5e9aa9b5ef024c6 100644 (file)
@@ -1502,6 +1502,15 @@ win32_process_target::write_pc (struct regcache *regcache, CORE_ADDR pc)
   return (*the_low_target.set_pc) (regcache, pc);
 }
 
+const char *
+win32_process_target::thread_name (ptid_t thread)
+{
+  windows_thread_info *th
+    = windows_process.thread_rec (current_thread_ptid (),
+                                 DONT_INVALIDATE_CONTEXT);
+  return th->name.get ();
+}
+
 /* The win32 target ops object.  */
 
 static win32_process_target the_win32_target;
index 8856a84baa37e385c2bd2442622db671fb66789d..a1d74573cc96a6f32375aec1c9db44cb057d7aee 100644 (file)
@@ -158,6 +158,8 @@ public:
   bool stopped_by_sw_breakpoint () override;
 
   bool supports_stopped_by_sw_breakpoint () override;
+
+  const char *thread_name (ptid_t thread) override;
 };
 
 /* Retrieve the context for this thread, if not already retrieved.  */