summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2021-12-01 18:56:29 -0800
committerMed Ismail Bennani <medismail.bennani@gmail.com>2021-12-06 16:11:59 -0800
commitcaea440a11e47bf86b0e43feb28a9287e4fbe3f8 (patch)
treeb21ee6f95800aea549f5cd7029ffba3a999d5766 /lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
parent6fef466779cafea30b82780c481896de187596c6 (diff)
[lldb/plugins] Add arm64(e) support to ScriptedProcess
This patch adds support for arm64(e) targets to ScriptedProcess, by providing the `DynamicRegisterInfo` to the base `lldb.ScriptedThread` class. This allows create and debugging ScriptedProcess on Apple Silicon hardware as well as Apple mobile devices. It also replace the C++ asserts on `ScriptedThread::GetDynamicRegisterInfo` by some error logging, re-enables `TestScriptedProcess` for arm64 Darwin platforms and adds a new invalid Scripted Thread test. rdar://85892451 Differential Revision: https://reviews.llvm.org/D114923 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.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
index c1b7294a7f58..cb21a3e7e65f 100644
--- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
+++ b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
@@ -311,6 +311,11 @@ bool ScriptedProcess::DoUpdateThreadList(ThreadList &old_thread_list,
return GetInterface().ErrorWithMessage<bool>(LLVM_PRETTY_FUNCTION,
error.AsCString(), error);
+ RegisterContextSP reg_ctx_sp = thread_sp->GetRegisterContext();
+ if (!reg_ctx_sp)
+ return GetInterface().ErrorWithMessage<bool>(
+ LLVM_PRETTY_FUNCTION, "Invalid Register Context", error);
+
new_thread_list.AddThread(thread_sp);
return new_thread_list.GetSize(false) > 0;