summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2021-11-23 20:35:12 +0000
committerPedro Alves <pedro@palves.net>2022-07-18 17:33:31 +0100
commite5a5c15bdc3a8df561b0f7fff7af51d6725500b6 (patch)
tree23a48a0c5b04c36cb8b4b7f79ff8edd2c9feb5ac
parent3494a6e7ac81d9f27da8acf28f14b72dedd8d11f (diff)
downloadbinutils-gdb-e5a5c15bdc3a8df561b0f7fff7af51d6725500b6.tar.gz
Thread options & clone events (native Linux)
This commit teaches the native Linux target about the GDB_TO_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 report support for the option, otherwise GDB falls back to use target_thread_events(). Change-Id: If271f20320d864f074d8ac0d531cc1a323da847f Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19675 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27830
-rw-r--r--gdb/linux-nat.c7
-rw-r--r--gdb/linux-nat.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 23d42b5fd55..4ddc54ff8bc 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -4416,6 +4416,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_TO_CLONE;
+ return ((options & supported_options) == options);
+}
+
linux_nat_target::linux_nat_target ()
{
/* We don't change the stratum; this target will sit at
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
index 683173dbd38..c449dc77a5e 100644
--- a/gdb/linux-nat.h
+++ b/gdb/linux-nat.h
@@ -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;