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

Boris Ulasevich via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 25 12:58:43 PST 2017


boris.ulasevich created this revision.

Additional change for https://reviews.llvm.org/D26497, https://reviews.llvm.org/D28945 - fix for TestCallThatThrows test fail (works for Mac only).

Recent change of stop reason priorities affected function call mechanism: it is important that CallFunctionThreadPlan complete event StopInfo should not be overridden by other simultaneous events (internal breakpoint?), otherwise caller do not get proper return value.

This change is a kind of fast fix for the test broken by my yesterday's change. I should admit, I do not like the code around, but any further change leads to tests fails with tedious LIBLLDB_LOG_STEP logs investigation.


Repository:
  rL LLVM

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,17 @@
                   do_resume = false;
                   handle_running_event = true;
                 } else {
+                  if (thread->IsThreadPlanDone(thread_plan_sp.get())) {
+                    // clean preset StopInfo value when we have out plan completed
+                    thread_sp->ResetStopInfo();
+                  }
                   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) {
+                  if (stop_reason == eStopReasonPlanComplete &&
+                      thread->IsThreadPlanDone(thread_plan_sp.get())) {
                     if (log)
                       log->PutCString("Process::RunThreadPlan(): execution "
                                       "completed successfully.");


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


More information about the lldb-commits mailing list