From 4858fe04a1571e78ff97b778c0fb6a46855c3d6a Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Tue, 18 Jan 2022 12:44:48 +0100 Subject: [lldb/Plugins] Add ScriptedProcess::GetThreadsInfo interface This patch adds a new method to the Scripted Process interface to retrive a dictionary of Scripted Threads. It uses the thread ID as a key and the Scripted Thread instance as the value. This dictionary will be used to create Scripted Threads in lldb and perform calls to the python scripted thread object. rdar://87427126 Differential Revision: https://reviews.llvm.org/D117068 Signed-off-by: Med Ismail Bennani --- .../Python/ScriptedProcessPythonInterface.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp index da8ff42..447bcee 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp @@ -92,6 +92,17 @@ ScriptedProcessPythonInterface::GetMemoryRegionContainingAddress( return mem_region; } +StructuredData::DictionarySP ScriptedProcessPythonInterface::GetThreadsInfo() { + Status error; + StructuredData::DictionarySP dict = + Dispatch("get_threads_info", error); + + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error)) + return {}; + + return dict; +} + StructuredData::DictionarySP ScriptedProcessPythonInterface::GetThreadWithID(lldb::tid_t tid) { Status error; -- cgit v1.1