aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Target/Process.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2011-05-17 01:10:11 +0000
committerJim Ingham <jingham@apple.com>2011-05-17 01:10:11 +0000
commit160f78c5846c8fe774a1ccfc044d263b7b30ad9c (patch)
tree332b9c5e803a03b373d8609960a5f32b35f48671 /lldb/source/Target/Process.cpp
parentceee5e813364a34db3ad99926fd05dce69e4bb44 (diff)
downloadllvm-160f78c5846c8fe774a1ccfc044d263b7b30ad9c.zip
llvm-160f78c5846c8fe774a1ccfc044d263b7b30ad9c.tar.gz
llvm-160f78c5846c8fe774a1ccfc044d263b7b30ad9c.tar.bz2
Fix the error message when an expression evaluation is interrupted by a crash/breakpoint hit to
give the reason for the interrupt. Also make sure it we don't want to unwind from the evaluation we print something if it is interrupted. llvm-svn: 131448
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r--lldb/source/Target/Process.cpp41
1 files changed, 36 insertions, 5 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index f185d57..88b813c 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -3498,11 +3498,40 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx,
switch (stop_state)
{
case lldb::eStateStopped:
- // Yay, we're done.
- if (log)
- log->Printf ("Execution completed successfully.");
- return_value = eExecutionCompleted;
- break;
+ {
+ // Yay, we're done. Now make sure that our thread plan actually completed.
+ ThreadSP thread_sp = exe_ctx.process->GetThreadList().FindThreadByIndexID (tid);
+ if (!thread_sp)
+ {
+ // Ooh, our thread has vanished. Unlikely that this was successful execution...
+ if (log)
+ log->Printf ("Execution completed but our thread has vanished.");
+ return_value = eExecutionInterrupted;
+ }
+ else
+ {
+ StopInfoSP stop_info_sp = thread_sp->GetStopInfo ();
+ StopReason 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 (true);
+ return_value = eExecutionCompleted;
+ }
+ else
+ {
+ if (log)
+ log->Printf ("Thread plan didn't successfully complete.");
+
+ return_value = eExecutionInterrupted;
+ }
+ }
+ }
+ break;
case lldb::eStateCrashed:
if (log)
log->Printf ("Execution crashed.");
@@ -3515,6 +3544,8 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx,
default:
if (log)
log->Printf("Execution stopped with unexpected state: %s.", StateAsCString(stop_state));
+
+ errors.Printf ("Execution stopped with unexpected state.");
return_value = eExecutionInterrupted;
break;
}