From 7fa27ce4a07f19b07799a767fc29416f3b625afb Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 26 Jul 2023 21:03:47 +0200 Subject: Vendor import of llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the last commit before the upstream release/17.x branch was created. --- lldb/source/Plugins/Process/scripted/ScriptedThread.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'lldb/source/Plugins/Process/scripted/ScriptedThread.cpp') diff --git a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp index ad0d26af8879..684375957d24 100644 --- a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp +++ b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp @@ -35,7 +35,7 @@ ScriptedThread::Create(ScriptedProcess &process, return llvm::createStringError(llvm::inconvertibleErrorCode(), "Invalid scripted process."); - process.CheckInterpreterAndScriptObject(); + process.CheckScriptedInterface(); auto scripted_thread_interface = process.GetInterface().CreateScriptedThreadInterface(); @@ -250,14 +250,19 @@ bool ScriptedThread::CalculateStopInfo() { StopInfo::CreateStopReasonWithBreakpointSiteID(*this, break_id); } break; case lldb::eStopReasonSignal: { - int signal; + uint32_t signal; llvm::StringRef description; - data_dict->GetValueForKeyAsInteger("signal", signal, - LLDB_INVALID_SIGNAL_NUMBER); + if (!data_dict->GetValueForKeyAsInteger("signal", signal)) { + signal = LLDB_INVALID_SIGNAL_NUMBER; + return false; + } data_dict->GetValueForKeyAsString("desc", description); stop_info_sp = StopInfo::CreateStopReasonWithSignal(*this, signal, description.data()); } break; + case lldb::eStopReasonTrace: { + stop_info_sp = StopInfo::CreateStopReasonToTrace(*this); + } break; case lldb::eStopReasonException: { #if defined(__APPLE__) StructuredData::Dictionary *mach_exception; @@ -280,7 +285,7 @@ bool ScriptedThread::CalculateStopInfo() { auto fetch_data = [&raw_codes](StructuredData::Object *obj) { if (!obj) return false; - raw_codes.push_back(obj->GetIntegerValue()); + raw_codes.push_back(obj->GetUnsignedIntegerValue()); return true; }; @@ -338,7 +343,7 @@ std::shared_ptr ScriptedThread::GetDynamicRegisterInfo() { LLVM_PRETTY_FUNCTION, "Failed to get scripted thread registers info.", error, LLDBLog::Thread); - m_register_info_sp = std::make_shared( + m_register_info_sp = DynamicRegisterInfo::Create( *reg_info, m_scripted_process.GetTarget().GetArchitecture()); } -- cgit v1.3