diff options
| author | Felipe de Azevedo Piovezan <fpiovezan@apple.com> | 2025-01-16 15:05:46 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-16 15:05:46 -0800 |
| commit | cb82771c96d7055d89ca67f383e6fb3c9aced178 (patch) | |
| tree | 26a08cfcd5b6d1201c4db933d1491b8185bfad8a /lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp | |
| parent | bb6e94a05d15d289e3685c5599f0eb905dc46925 (diff) | |
[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/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp')
| -rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/Interfaces/OperatingSystemPythonInterface.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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<bool> 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<llvm::StringRef> ci_usages = { "settings set target.process.python-os-plugin-path <script-path>", |
