]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Thread options & clone events (native Linux)
authorPedro Alves <pedro@palves.net>
Tue, 23 Nov 2021 20:35:12 +0000 (20:35 +0000)
committerPedro Alves <pedro@palves.net>
Fri, 10 Mar 2023 19:14:18 +0000 (19:14 +0000)
This commit teaches the native Linux target about the
GDB_THREAD_OPTION_CLONE thread option.  It's actually simpler to just
continue reporting all clone events unconditionally to the core.
There's never any harm in reporting a clone event when the option is
disabled.  All we need to do is to report support for the option,
otherwise GDB falls back to use target_thread_events().

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19675
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27830
Change-Id: If90316e2dcd0c61d0fefa0d463c046011698acf9

gdb/linux-nat.c
gdb/linux-nat.h

index f66ecbce286f2fd6de99e39b525c35ced842f72f..816a5a0491c9d496123947f8bb2378f6a92904cd 100644 (file)
@@ -4467,6 +4467,13 @@ linux_nat_target::thread_events (int enable)
   report_thread_events = enable;
 }
 
+bool
+linux_nat_target::supports_set_thread_options (gdb_thread_options options)
+{
+  constexpr gdb_thread_options supported_options = GDB_THREAD_OPTION_CLONE;
+  return ((options & supported_options) == options);
+}
+
 linux_nat_target::linux_nat_target ()
 {
   /* We don't change the stratum; this target will sit at
index 1cdbeafd4f344d76046d8fa7818d76308d573a46..cf236160b4a64b936afe6087b2c5ffb670c4da44 100644 (file)
@@ -82,6 +82,8 @@ public:
 
   void thread_events (int) override;
 
+  bool supports_set_thread_options (gdb_thread_options options) override;
+
   bool can_async_p () override;
 
   bool supports_non_stop () override;