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. --- .../Python/Interfaces/OperatingSystemPythonInterface.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp index c3379e774a0b..d8b2ea984fd8 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp @@ -82,6 +82,16 @@ OperatingSystemPythonInterface::GetRegisterContextForTID(lldb::tid_t tid) { return obj->GetAsString()->GetValue().str(); } +std::optional OperatingSystemPythonInterface::DoesPluginReportAllThreads() { + Status error; + StructuredData::ObjectSP obj = Dispatch("does_plugin_report_all_threads", error); + if (!ScriptedInterface::CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, + error)) + return {}; + + return obj->GetAsBoolean()->GetValue(); +} + void OperatingSystemPythonInterface::Initialize() { const std::vector ci_usages = { "settings set target.process.python-os-plugin-path ", -- cgit v1.2.3