From 1b86344fa80bd11853e0347ea33dc6cb5a460c4f Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Tue, 18 Jan 2022 12:45:27 +0100 Subject: [lldb/Plugins] Move ScriptedThreadInterface to ScriptedThread Since we can have multiple Scripted Threads per Scripted Process, having only a single ScriptedThreadInterface (with a single object instance) will cause the method calls to be done on the wrong object. Instead, this patch creates a separate ScriptedThreadInterface for each new lldb_private::ScriptedThread to make sure we interact with the right instance. rdar://87427911 Differential Revision: https://reviews.llvm.org/D117070 Signed-off-by: Med Ismail Bennani --- .../ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (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 447bcee..29516c4 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp @@ -165,12 +165,8 @@ ScriptedProcessPythonInterface::GetScriptedThreadPluginName() { } lldb::ScriptedThreadInterfaceSP -ScriptedProcessPythonInterface::GetScriptedThreadInterface() { - if (!m_scripted_thread_interface_sp) - m_scripted_thread_interface_sp = - std::make_shared(m_interpreter); - - return m_scripted_thread_interface_sp; +ScriptedProcessPythonInterface::CreateScriptedThreadInterface() { + return std::make_shared(m_interpreter); } #endif -- cgit v1.1