diff --git a/lldb/include/lldb/Utility/StructuredData.h b/lldb/include/lldb/Utility/StructuredData.h --- a/lldb/include/lldb/Utility/StructuredData.h +++ b/lldb/include/lldb/Utility/StructuredData.h @@ -484,6 +484,7 @@ } return success; } + template bool GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const { ObjectSP value_sp = GetValueForKey(key); diff --git a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp --- a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp +++ b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp @@ -250,10 +250,12 @@ 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()); diff --git a/lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py b/lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py --- a/lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py +++ b/lldb/test/API/functionalities/scripted_process/TestStackCoreScriptedProcess.py @@ -35,7 +35,6 @@ @skipIfOutOfTreeDebugserver @skipIfRemote @skipIfAsan # On ASAN builds, this test times-out (rdar://98678134) - @skipIfDarwin def test_launch_scripted_process_stack_frames(self): """Test that we can launch an lldb scripted process from the command line, check its process ID and read string from memory."""