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.");
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.");
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits