diff options
author | Jim Ingham <jingham@apple.com> | 2013-04-25 02:04:59 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2013-04-25 02:04:59 +0000 |
commit | 0ad7e0545b1313300c8d75044568e5aba4095bfd (patch) | |
tree | 9b0a157c2b5d4be6e50b486201c606e87cf02997 /lldb/source/Target/Process.cpp | |
parent | 10a7a598711b18ba0e5a7b35254c0732d905142b (diff) | |
download | bcm5719-llvm-0ad7e0545b1313300c8d75044568e5aba4095bfd.tar.gz bcm5719-llvm-0ad7e0545b1313300c8d75044568e5aba4095bfd.zip |
In Process::ProcessEventData::DoOnRemoval, we need to handle the case where NO thread has a stop reason
specially, and make sure we stop. This shouldn't happen, but if it does, the user will probably want to
see it.
<rdar://problem/13273125>
llvm-svn: 180244
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r-- | lldb/source/Target/Process.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 149c225e2bb..f60adca741e 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -4094,6 +4094,12 @@ Process::ProcessEventData::DoOnRemoval (Event *event_ptr) bool still_should_stop = false; + // Sometimes - for instance if we have a bug in the stub we are talking to, we stop but no thread has a + // valid stop reason. In that case we should just stop, because we have no way of telling what the right + // thing to do is, and it's better to let the user decide than continue behind their backs. + + bool does_anybody_have_an_opinion = false; + for (idx = 0; idx < num_threads; ++idx) { curr_thread_list = m_process_sp->GetThreadList(); @@ -4121,6 +4127,7 @@ Process::ProcessEventData::DoOnRemoval (Event *event_ptr) StopInfoSP stop_info_sp = thread_sp->GetStopInfo (); if (stop_info_sp && stop_info_sp->IsValid()) { + does_anybody_have_an_opinion = true; bool this_thread_wants_to_stop; if (stop_info_sp->GetOverrideShouldStop()) { @@ -4152,7 +4159,7 @@ Process::ProcessEventData::DoOnRemoval (Event *event_ptr) if (m_process_sp->GetPrivateState() != eStateRunning) { - if (!still_should_stop) + if (!still_should_stop && does_anybody_have_an_opinion) { // We've been asked to continue, so do that here. SetRestarted(true); |