From cb82771c96d7055d89ca67f383e6fb3c9aced178 Mon Sep 17 00:00:00 2001 From: Felipe de Azevedo Piovezan Date: Thu, 16 Jan 2025 15:05:46 -0800 Subject: [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. --- .../Plugins/OperatingSystem/Python/OperatingSystemPython.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp') diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index 3848a2b1deb9..aff521890858 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 plugin_answer = + m_operating_system_interface_sp->DoesPluginReportAllThreads()) + return *plugin_answer; + return m_process->GetOSPluginReportsAllThreads(); +} + #endif // #if LLDB_ENABLE_PYTHON -- cgit v1.2.3