diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp @@ -1157,13 +1157,8 @@ flag_value.GetScalar() = 0; // FIXME - Set to 0 when debugging is done. dispatch_values.PushValue(flag_value); - // The step through code might have to fill in the cache, so it - // is not safe to run only one thread. So we override the - // stop_others value passed in to us here: - const bool trampoline_stop_others = false; ret_plan_sp = std::make_shared( - thread, *this, dispatch_values, isa_addr, sel_addr, - trampoline_stop_others); + thread, *this, dispatch_values, isa_addr, sel_addr); if (log) { StreamString s; ret_plan_sp->GetDescription(&s, eDescriptionLevelFull); @@ -1182,13 +1177,9 @@ MsgsendMap::iterator pos; pos = m_opt_dispatch_map.find(curr_pc); if (pos != m_opt_dispatch_map.end()) { - const char *opt_name = g_opt_dispatch_names[(*pos).second]; - - bool trampoline_stop_others = false; - LazyBool step_in_should_stop = eLazyBoolCalculate; - ret_plan_sp = std::make_shared ( - thread, *this, opt_name, trampoline_stop_others, step_in_should_stop); + ret_plan_sp = std::make_shared( + thread, *this, opt_name); } } diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h @@ -24,8 +24,7 @@ public: AppleThreadPlanStepThroughObjCTrampoline( Thread &thread, AppleObjCTrampolineHandler &trampoline_handler, - ValueList &values, lldb::addr_t isa_addr, lldb::addr_t sel_addr, - bool stop_others); + ValueList &values, lldb::addr_t isa_addr, lldb::addr_t sel_addr); ~AppleThreadPlanStepThroughObjCTrampoline() override; @@ -39,7 +38,9 @@ bool ShouldStop(Event *event_ptr) override; - bool StopOthers() override { return m_stop_others; } + // The step through code might have to fill in the cache, so it is not safe + // to run only one thread. + bool StopOthers() override { return false; } // The base class MischiefManaged does some cleanup - so you have to call it // in your MischiefManaged derived class. @@ -69,15 +70,13 @@ FunctionCaller *m_impl_function; /// This is a pointer to a impl function that /// is owned by the client that pushes this /// plan. - bool m_stop_others; /// Whether we should stop other threads. }; class AppleThreadPlanStepThroughDirectDispatch: public ThreadPlanStepOut { public: - AppleThreadPlanStepThroughDirectDispatch( - Thread &thread, AppleObjCTrampolineHandler &handler, - llvm::StringRef dispatch_func_name, bool stop_others, - LazyBool step_in_avoids_code_without_debug_info); + AppleThreadPlanStepThroughDirectDispatch(Thread &thread, + AppleObjCTrampolineHandler &handler, + llvm::StringRef dispatch_func_name); ~AppleThreadPlanStepThroughDirectDispatch() override; @@ -85,7 +84,7 @@ bool ShouldStop(Event *event_ptr) override; - bool StopOthers() override { return m_stop_others; } + bool StopOthers() override { return false; } bool MischiefManaged() override; @@ -107,7 +106,6 @@ std::vector m_msgSend_bkpts; /// Breakpoints on the objc /// dispatch functions. bool m_at_msg_send; /// Are we currently handling an msg_send - bool m_stop_others; /// Whether we should stop other threads. }; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp @@ -30,15 +30,13 @@ AppleThreadPlanStepThroughObjCTrampoline:: AppleThreadPlanStepThroughObjCTrampoline( Thread &thread, AppleObjCTrampolineHandler &trampoline_handler, - ValueList &input_values, lldb::addr_t isa_addr, lldb::addr_t sel_addr, - bool stop_others) + ValueList &input_values, lldb::addr_t isa_addr, lldb::addr_t sel_addr) : ThreadPlan(ThreadPlan::eKindGeneric, "MacOSX Step through ObjC Trampoline", thread, eVoteNoOpinion, eVoteNoOpinion), m_trampoline_handler(trampoline_handler), m_args_addr(LLDB_INVALID_ADDRESS), m_input_values(input_values), - m_isa_addr(isa_addr), m_sel_addr(sel_addr), m_impl_function(nullptr), - m_stop_others(stop_others) {} + m_isa_addr(isa_addr), m_sel_addr(sel_addr), m_impl_function(nullptr) {} // Destructor AppleThreadPlanStepThroughObjCTrampoline:: @@ -66,7 +64,7 @@ EvaluateExpressionOptions options; options.SetUnwindOnError(true); options.SetIgnoreBreakpoints(true); - options.SetStopOthers(m_stop_others); + options.SetStopOthers(false); GetThread().CalculateExecutionContext(exc_ctx); m_func_sp = m_impl_function->GetThreadPlanToCallFunction( exc_ctx, m_args_addr, options, diagnostics); @@ -157,7 +155,7 @@ const bool first_insn = true; const uint32_t frame_idx = 0; m_run_to_sp = GetThread().QueueThreadPlanForStepOutNoShouldStop( - abort_other_plans, &sc, first_insn, m_stop_others, eVoteNoOpinion, + abort_other_plans, &sc, first_insn, false, eVoteNoOpinion, eVoteNoOpinion, frame_idx, status); if (m_run_to_sp && status.Success()) m_run_to_sp->SetPrivate(true); @@ -179,7 +177,7 @@ // Extract the target address from the value: m_run_to_sp = std::make_shared( - GetThread(), target_so_addr, m_stop_others); + GetThread(), target_so_addr, false); PushPlan(m_run_to_sp); return false; } else if (GetThread().IsThreadPlanDone(m_run_to_sp.get())) { @@ -222,10 +220,9 @@ AppleThreadPlanStepThroughDirectDispatch :: AppleThreadPlanStepThroughDirectDispatch( Thread &thread, AppleObjCTrampolineHandler &handler, - llvm::StringRef dispatch_func_name, bool stop_others, - LazyBool step_in_avoids_code_without_debug_info) - : ThreadPlanStepOut(thread, nullptr, true /* first instruction */, - stop_others, eVoteNoOpinion, eVoteNoOpinion, + llvm::StringRef dispatch_func_name) + : ThreadPlanStepOut(thread, nullptr, true /* first instruction */, false, + eVoteNoOpinion, eVoteNoOpinion, 0 /* Step out of zeroth frame */, eLazyBoolNo /* Our parent plan will decide this when we are done */ @@ -234,7 +231,7 @@ false /* Don't gather the return value */), m_trampoline_handler(handler), m_dispatch_func_name(std::string(dispatch_func_name)), - m_at_msg_send(false), m_stop_others(stop_others) { + m_at_msg_send(false) { // Set breakpoints on the dispatch functions: auto bkpt_callback = [&] (lldb::addr_t addr, const AppleObjCTrampolineHandler @@ -249,20 +246,7 @@ // We'll set the step-out plan in the DidPush so it gets queued in the right // order. - bool avoid_nodebug = true; - - switch (step_in_avoids_code_without_debug_info) { - case eLazyBoolYes: - avoid_nodebug = true; - break; - case eLazyBoolNo: - avoid_nodebug = false; - break; - case eLazyBoolCalculate: - avoid_nodebug = GetThread().GetStepInAvoidsNoDebug(); - break; - } - if (avoid_nodebug) + if (GetThread().GetStepInAvoidsNoDebug()) GetFlags().Set(ThreadPlanShouldStopHere::eStepInAvoidNoDebug); else GetFlags().Clear(ThreadPlanShouldStopHere::eStepInAvoidNoDebug); @@ -398,8 +382,8 @@ // There's no way we could have gotten here without an ObjC language // runtime. assert(objc_runtime); - m_objc_step_through_sp - = objc_runtime->GetStepThroughTrampolinePlan(GetThread(), m_stop_others); + m_objc_step_through_sp = + objc_runtime->GetStepThroughTrampolinePlan(GetThread(), false); // If we failed to find the target for this dispatch, just keep going and // let the step out complete. if (!m_objc_step_through_sp) {