[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>
This commit is contained in:
Med Ismail Bennani
2021-12-01 18:56:29 -08:00
parent 6fef466779
commit caea440a11
5 changed files with 176 additions and 13 deletions

View File

@@ -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;