[Lldb-commits] [PATCH] D29144: LLDB: fix for TestCallThatThrows.py test fail

Boris Ulasevich via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 27 11:56:04 PST 2017


boris.ulasevich updated this revision to Diff 86091.
boris.ulasevich added a comment.

I made another diff with using GetCompletedPlan call. Hope it makes the code clear.


https://reviews.llvm.org/D29144

Files:
  lldb/source/Target/Process.cpp


Index: lldb/source/Target/Process.cpp
===================================================================
--- lldb/source/Target/Process.cpp
+++ lldb/source/Target/Process.cpp
@@ -5248,15 +5248,9 @@
                   do_resume = false;
                   handle_running_event = true;
                 } else {
-                  StopInfoSP stop_info_sp(thread_sp->GetStopInfo());
-                  StopReason stop_reason = eStopReasonInvalid;
-                  if (stop_info_sp)
-                    stop_reason = stop_info_sp->GetStopReason();
-
-                  // FIXME: We only check if the stop reason is plan complete,
-                  // should we make sure that
-                  // it is OUR plan that is complete?
-                  if (stop_reason == eStopReasonPlanComplete) {
+                  ThreadPlanSP plan_sp = thread->GetCompletedPlan();
+                  if (plan_sp == thread_plan_sp && plan_sp->PlanSucceeded()) {
+
                     if (log)
                       log->PutCString("Process::RunThreadPlan(): execution "
                                       "completed successfully.");
@@ -5267,9 +5261,11 @@
 
                     return_value = eExpressionCompleted;
                   } else {
+                    StopInfoSP stop_info_sp = thread_sp->GetStopInfo();
                     // Something restarted the target, so just wait for it to
                     // stop for real.
-                    if (stop_reason == eStopReasonBreakpoint) {
+                    if (stop_info_sp &&
+                        stop_info_sp->GetStopReason() == eStopReasonBreakpoint) {
                       if (log)
                         log->Printf("Process::RunThreadPlan() stopped for "
                                     "breakpoint: %s.",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29144.86091.patch
Type: text/x-patch
Size: 1780 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170127/bac8be80/attachment.bin>


More information about the lldb-commits mailing list