summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2021-11-10 19:53:14 +0000
committerMed Ismail Bennani <medismail.bennani@gmail.com>2021-11-11 00:13:58 +0100
commit676576b6f027516c8ea1b45f6da3cd1b94a851a2 (patch)
treebf793350689eec435a03d64316fdafd5d9bef334 /lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
parentfddc4e41164e2fd152605362639eb3255cc75212 (diff)
[lldb/Plugins] Refactor ScriptedThread register context creation
This patch changes the ScriptedThread class to create the register context when Process::RefreshStateAfterStop is called rather than doing it in the thread constructor. This is required to update the thread state for execution control. Differential Revision: https://reviews.llvm.org/D112167 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp')
-rw-r--r--lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
index 23659bdb8a47..15d3d43d9993 100644
--- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
+++ b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
@@ -20,7 +20,6 @@
#include "lldb/Interpreter/ScriptInterpreter.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Target/RegisterContext.h"
-
#include "lldb/Utility/State.h"
#include <mutex>
@@ -291,6 +290,7 @@ bool ScriptedProcess::DoUpdateThreadList(ThreadList &old_thread_list,
// actually new threads will get added to new_thread_list.
CheckInterpreterAndScriptObject();
+ m_thread_plans.ClearThreadCache();
Status error;
ScriptLanguage language = m_interpreter->GetLanguage();
@@ -316,6 +316,12 @@ bool ScriptedProcess::DoUpdateThreadList(ThreadList &old_thread_list,
return new_thread_list.GetSize(false) > 0;
}
+void ScriptedProcess::RefreshStateAfterStop() {
+ // Let all threads recover from stopping and do any clean up based on the
+ // previous thread state (if any).
+ m_thread_list.RefreshStateAfterStop();
+}
+
bool ScriptedProcess::GetProcessInfo(ProcessInstanceInfo &info) {
info.Clear();
info.SetProcessID(GetID());