diff options
| author | Med Ismail Bennani <medismail.bennani@gmail.com> | 2022-01-18 12:45:27 +0100 |
|---|---|---|
| committer | Med Ismail Bennani <medismail.bennani@gmail.com> | 2022-01-24 20:25:53 +0100 |
| commit | 1b86344fa80bd11853e0347ea33dc6cb5a460c4f (patch) | |
| tree | 8019bb265ddb0dd2ff95eed05b1bd66e249b7714 /lldb/source/Plugins/Process/scripted/ScriptedThread.cpp | |
| parent | 4858fe04a1571e78ff97b778c0fb6a46855c3d6a (diff) | |
[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 <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/source/Plugins/Process/scripted/ScriptedThread.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/scripted/ScriptedThread.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp index 959b8c581885..4185e1b67587 100644 --- a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp +++ b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp @@ -29,7 +29,9 @@ void ScriptedThread::CheckInterpreterAndScriptObject() const { } ScriptedThread::ScriptedThread(ScriptedProcess &process, Status &error) - : Thread(process, LLDB_INVALID_THREAD_ID), m_scripted_process(process) { + : Thread(process, LLDB_INVALID_THREAD_ID), m_scripted_process(process), + m_scripted_thread_interface_sp( + m_scripted_process.GetInterface().CreateScriptedThreadInterface()) { if (!process.IsValid()) { error.SetErrorString("Invalid scripted process"); return; @@ -190,7 +192,7 @@ void ScriptedThread::RefreshStateAfterStop() { } lldb::ScriptedThreadInterfaceSP ScriptedThread::GetInterface() const { - return m_scripted_process.GetInterface().GetScriptedThreadInterface(); + return m_scripted_thread_interface_sp; } std::shared_ptr<DynamicRegisterInfo> ScriptedThread::GetDynamicRegisterInfo() { |
