aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/OperatingSystem/Python
diff options
context:
space:
mode:
authorFelipe de Azevedo Piovezan <fpiovezan@apple.com>2025-01-16 15:05:46 -0800
committerGitHub <noreply@github.com>2025-01-16 15:05:46 -0800
commitcb82771c96d7055d89ca67f383e6fb3c9aced178 (patch)
tree26a08cfcd5b6d1201c4db933d1491b8185bfad8a /lldb/source/Plugins/OperatingSystem/Python
parentbb6e94a05d15d289e3685c5599f0eb905dc46925 (diff)
downloadllvm-cb82771c96d7055d89ca67f383e6fb3c9aced178.zip
llvm-cb82771c96d7055d89ca67f383e6fb3c9aced178.tar.gz
llvm-cb82771c96d7055d89ca67f383e6fb3c9aced178.tar.bz2
[lldb] Add OS plugin property for reporting all threads (#123145)
Currently, an LLDB target option controls whether plugins report all threads. However, it seems natural for this knowledge could come from the plugin itself. To support this, this commits adds a virtual method to the plugin base class, making the Python OS query the target option to preserve existing behavior.
Diffstat (limited to 'lldb/source/Plugins/OperatingSystem/Python')
-rw-r--r--lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp8
-rw-r--r--lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
index 3848a2b..aff5218 100644
--- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
+++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
@@ -386,4 +386,12 @@ lldb::ThreadSP OperatingSystemPython::CreateThread(lldb::tid_t tid,
return ThreadSP();
}
+bool OperatingSystemPython::DoesPluginReportAllThreads() {
+ // If the python plugin has a "DoesPluginReportAllThreads" method, use it.
+ if (std::optional<bool> plugin_answer =
+ m_operating_system_interface_sp->DoesPluginReportAllThreads())
+ return *plugin_answer;
+ return m_process->GetOSPluginReportsAllThreads();
+}
+
#endif // #if LLDB_ENABLE_PYTHON
diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
index 90973ac..980a544 100644
--- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
+++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
@@ -60,6 +60,8 @@ public:
// Method for lazy creation of threads on demand
lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context) override;
+ bool DoesPluginReportAllThreads() override;
+
protected:
bool IsValid() const {
return m_script_object_sp && m_script_object_sp->IsValid();