summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/scripted/ScriptedThread.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/ScriptedThread.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/ScriptedThread.cpp')
-rw-r--r--lldb/source/Plugins/Process/scripted/ScriptedThread.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
index 1adbd4e7799d..959b8c581885 100644
--- a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
+++ b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
@@ -198,13 +198,17 @@ std::shared_ptr<DynamicRegisterInfo> ScriptedThread::GetDynamicRegisterInfo() {
if (!m_register_info_sp) {
StructuredData::DictionarySP reg_info = GetInterface()->GetRegisterInfo();
+
+ Status error;
if (!reg_info)
- return nullptr;
+ return GetInterface()
+ ->ErrorWithMessage<std::shared_ptr<DynamicRegisterInfo>>(
+ LLVM_PRETTY_FUNCTION,
+ "Failed to get scripted thread registers info.", error,
+ LIBLLDB_LOG_THREAD);
m_register_info_sp = std::make_shared<DynamicRegisterInfo>(
*reg_info, m_scripted_process.GetTarget().GetArchitecture());
- assert(m_register_info_sp->GetNumRegisters() > 0);
- assert(m_register_info_sp->GetNumRegisterSets() > 0);
}
return m_register_info_sp;