aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter/ScriptInterpreter.cpp
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2023-02-06 16:02:51 -0800
committerMed Ismail Bennani <medismail.bennani@gmail.com>2023-02-06 16:02:51 -0800
commita3d4f739eea357c702754246442a2568f2bace81 (patch)
treef7496bd6a52bb6ff9b33e006c915d56a820effdc /lldb/source/Interpreter/ScriptInterpreter.cpp
parentc6ea5b0cd1728a044a4c5b3c8f1bf35e1d8d2847 (diff)
downloadllvm-a3d4f739eea357c702754246442a2568f2bace81.zip
llvm-a3d4f739eea357c702754246442a2568f2bace81.tar.gz
llvm-a3d4f739eea357c702754246442a2568f2bace81.tar.bz2
[lldb/Plugins] Fix method dispatch bug when using multiple scripted processes
This patch should address a bug when a user have multiple scripted processes in the same debugging session. In order for the scripted process plugin to be able to call into the scripted object instance methods to fetch the necessary data to reconstruct its state, the scripted process plugin calls into a scripted process interface, that has a reference to the created script object instance. However, prior to this patch, we only had a single instance of the scripted process interface, living the script interpreter. So every time a new scripted process plugin was created, it would overwrite the script object instance that was held by the single scripted process interface in the script interpreter. That would cause all the method calls made to the scripted process interface to be dispatched by the last instanciated script object instance, which is wrong. In order to prevent that, this patch moves the scripted process interface reference to be help by the scripted process plugin itself. rdar://104882562 Differential Revision: https://reviews.llvm.org/D143308 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/ScriptInterpreter.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp
index 2722666..60b676d 100644
--- a/lldb/source/Interpreter/ScriptInterpreter.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreter.cpp
@@ -29,10 +29,8 @@ using namespace lldb_private;
ScriptInterpreter::ScriptInterpreter(
Debugger &debugger, lldb::ScriptLanguage script_lang,
- lldb::ScriptedProcessInterfaceUP scripted_process_interface_up,
lldb::ScriptedPlatformInterfaceUP scripted_platform_interface_up)
: m_debugger(debugger), m_script_lang(script_lang),
- m_scripted_process_interface_up(std::move(scripted_process_interface_up)),
m_scripted_platform_interface_up(
std::move(scripted_platform_interface_up)) {}