diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -2471,8 +2471,12 @@ for (const auto &thread_sp : process_sp->GetThreadList().Threads()) { StopInfoSP stop_info = thread_sp->GetStopInfo(); - if (!stop_info) - return false; + if (!stop_info) { + // If there's no stop_info, keep iterating through the other threads; + // it's enough that any thread has got a stop_info that indicates + // an abnormal stop, to consider the process to be stopped abnormally. + continue; + } const StopReason reason = stop_info->GetStopReason(); if (reason == eStopReasonException || diff --git a/lldb/test/Shell/Driver/CommandOnCrashMultiThreaded.test b/lldb/test/Shell/Driver/CommandOnCrashMultiThreaded.test new file mode 100644 --- /dev/null +++ b/lldb/test/Shell/Driver/CommandOnCrashMultiThreaded.test @@ -0,0 +1,6 @@ +# XFAIL: system-windows +# REQUIRES: native && (target-x86 || target-x86_64) +# RUN: %clangxx_host %p/Inputs/CommandOnCrashMultiThreaded.cpp -o %t -pthread +# RUN: %lldb -b -o "process launch" -k "process continue" -k "exit" %t | FileCheck %s + +# CHECK: Process {{[0-9]+}} exited with status = 0 diff --git a/lldb/test/Shell/Driver/Inputs/CommandOnCrashMultiThreaded.cpp b/lldb/test/Shell/Driver/Inputs/CommandOnCrashMultiThreaded.cpp new file mode 100644 --- /dev/null +++ b/lldb/test/Shell/Driver/Inputs/CommandOnCrashMultiThreaded.cpp @@ -0,0 +1,13 @@ +#include + +void t_func() { + asm volatile( + "int3\n\t" + ); +} + +int main() { + std::thread t(t_func); + t.join(); + return 0; +}