diff options
| author | Greg Clayton <gclayton@apple.com> | 2011-06-03 22:12:42 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2011-06-03 22:12:42 +0000 |
| commit | 54e8ac5562fcc83c50cc1a451401b3a1bd15fcc6 (patch) | |
| tree | 234936e0871d5a3ea2d19b2110e80e1d504cf643 | |
| parent | 1e3e8933edf5ed7a027003ff3fcbe1c93dee2cc8 (diff) | |
| download | bcm5719-llvm-54e8ac5562fcc83c50cc1a451401b3a1bd15fcc6.tar.gz bcm5719-llvm-54e8ac5562fcc83c50cc1a451401b3a1bd15fcc6.zip | |
Make sure we are ok to stop in a thread plan and have no stop reason for
the thread we were running on (other thread crashed or had exceptional stop
reason).
llvm-svn: 132599
| -rw-r--r-- | lldb/source/Target/Process.cpp | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 7acb87e5080..19a10576bd1 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -3439,49 +3439,54 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx, switch (stop_state) { case lldb::eStateStopped: - { - // Yay, we're done. Now make sure that our thread plan actually completed. - ThreadSP thread_sp = exe_ctx.process->GetThreadList().FindThreadByIndexID (thread_idx_id); - if (!thread_sp) - { - // Ooh, our thread has vanished. Unlikely that this was successful execution... - if (log) - log->Printf ("Execution completed but our thread (index-id=%u) has vanished.", thread_idx_id); - return_value = eExecutionInterrupted; - } - else { - StopInfoSP stop_info_sp = thread_sp->GetStopInfo (); - StopReason stop_reason = stop_info_sp->GetStopReason(); - if (stop_reason == eStopReasonPlanComplete) + // Yay, we're done. Now make sure that our thread plan actually completed. + ThreadSP thread_sp = exe_ctx.process->GetThreadList().FindThreadByIndexID (thread_idx_id); + if (!thread_sp) { + // Ooh, our thread has vanished. Unlikely that this was successful execution... if (log) - log->Printf ("Execution completed successfully."); - // Now mark this plan as private so it doesn't get reported as the stop reason - // after this point. - if (thread_plan_sp) - thread_plan_sp->SetPrivate (orig_plan_private); - return_value = eExecutionCompleted; + log->Printf ("Execution completed but our thread (index-id=%u) has vanished.", thread_idx_id); + return_value = eExecutionInterrupted; } else { - if (log) - log->Printf ("Thread plan didn't successfully complete."); - - return_value = eExecutionInterrupted; + StopInfoSP stop_info_sp (thread_sp->GetStopInfo ()); + StopReason stop_reason = eStopReasonInvalid; + if (stop_info_sp) + stop_reason = stop_info_sp->GetStopReason(); + if (stop_reason == eStopReasonPlanComplete) + { + if (log) + log->Printf ("Execution completed successfully."); + // Now mark this plan as private so it doesn't get reported as the stop reason + // after this point. + if (thread_plan_sp) + thread_plan_sp->SetPrivate (orig_plan_private); + return_value = eExecutionCompleted; + } + else + { + if (log) + log->Printf ("Thread plan didn't successfully complete."); + + return_value = eExecutionInterrupted; + } } - } - } - break; + } + break; + case lldb::eStateCrashed: if (log) log->Printf ("Execution crashed."); return_value = eExecutionInterrupted; break; + case lldb::eStateRunning: do_resume = false; keep_going = true; break; + default: if (log) log->Printf("Execution stopped with unexpected state: %s.", StateAsCString(stop_state)); |

