[Lldb-commits] [lldb] [NFC][lldb] Let subclasses of ThreadPlanStepOut set the plan kind and name (PR #230504)

via lldb-commits lldb-commits at lists.llvm.org
Fri Oct 9 06:46:17 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Felipe de Azevedo Piovezan (felipepiovezan)

<details>
<summary>Changes</summary>



Add a protected constructor that takes the kind and the name of the plan. The public constructor with the same arguments forwards to it with eKindStepOut and "Step out".

AppleThreadPlanStepThroughDirectDispatch uses it, so the step log names the plan "Step through ObjC direct dispatch" instead of "Step out".

---
Full diff: https://github.com/llvm/llvm-project/pull/230504.diff


3 Files Affected:

- (modified) lldb/include/lldb/Target/ThreadPlanStepOut.h (+7) 
- (modified) lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp (+5-4) 
- (modified) lldb/source/Target/ThreadPlanStepOut.cpp (+13-2) 


``````````diff
diff --git a/lldb/include/lldb/Target/ThreadPlanStepOut.h b/lldb/include/lldb/Target/ThreadPlanStepOut.h
index ad4434be14120a..42a447002103c7 100644
--- a/lldb/include/lldb/Target/ThreadPlanStepOut.h
+++ b/lldb/include/lldb/Target/ThreadPlanStepOut.h
@@ -51,6 +51,13 @@ class ThreadPlanStepOut : public ThreadPlan, public ThreadPlanShouldStopHere {
   }
 
 protected:
+  ThreadPlanStepOut(ThreadPlanKind kind, const char *name, Thread &thread,
+                    SymbolContext *addr_context, bool first_insn,
+                    bool stop_others, Vote report_stop_vote,
+                    Vote report_run_vote, uint32_t frame_idx,
+                    LazyBool step_out_avoids_code_without_debug_info,
+                    bool continue_to_next_branch, bool gather_return_value);
+
   void SetFlagsToDefault() override {
     GetFlags().Set(ThreadPlanStepOut::s_default_flag_values);
   }
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
index c212541c3b1cfc..f9cfd2eb0ee08c 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
@@ -237,12 +237,13 @@ bool AppleThreadPlanStepThroughObjCTrampoline::WillStop() { return true; }
 // since we can't just return control to the plan that's controlling us on the
 // first step.
 
-AppleThreadPlanStepThroughDirectDispatch ::
+AppleThreadPlanStepThroughDirectDispatch::
     AppleThreadPlanStepThroughDirectDispatch(
         Thread &thread, AppleObjCTrampolineHandler &handler)
-    : ThreadPlanStepOut(thread, nullptr, true /* first instruction */, false,
-                        eVoteNoOpinion, eVoteNoOpinion,
-                        0 /* Step out of zeroth frame */,
+    : ThreadPlanStepOut(ThreadPlan::eKindStepOut,
+                        "Step through ObjC direct dispatch", 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 */
                         ,
diff --git a/lldb/source/Target/ThreadPlanStepOut.cpp b/lldb/source/Target/ThreadPlanStepOut.cpp
index 34608000f1d4f8..d14e470461c087 100644
--- a/lldb/source/Target/ThreadPlanStepOut.cpp
+++ b/lldb/source/Target/ThreadPlanStepOut.cpp
@@ -64,8 +64,19 @@ ThreadPlanStepOut::ThreadPlanStepOut(
     Vote report_stop_vote, Vote report_run_vote, uint32_t frame_idx,
     LazyBool step_out_avoids_code_without_debug_info,
     bool continue_to_next_branch, bool gather_return_value)
-    : ThreadPlan(ThreadPlan::eKindStepOut, "Step out", thread, report_stop_vote,
-                 report_run_vote),
+    : ThreadPlanStepOut(ThreadPlan::eKindStepOut, "Step out", thread, context,
+                        first_insn, stop_others, report_stop_vote,
+                        report_run_vote, frame_idx,
+                        step_out_avoids_code_without_debug_info,
+                        continue_to_next_branch, gather_return_value) {}
+
+ThreadPlanStepOut::ThreadPlanStepOut(
+    ThreadPlanKind kind, const char *name, Thread &thread,
+    SymbolContext *context, bool first_insn, bool stop_others,
+    Vote report_stop_vote, Vote report_run_vote, uint32_t frame_idx,
+    LazyBool step_out_avoids_code_without_debug_info,
+    bool continue_to_next_branch, bool gather_return_value)
+    : ThreadPlan(kind, name, thread, report_stop_vote, report_run_vote),
       ThreadPlanShouldStopHere(this), m_step_from_insn(LLDB_INVALID_ADDRESS),
       m_return_bp_id(LLDB_INVALID_BREAK_ID),
       m_return_addr(LLDB_INVALID_ADDRESS), m_stop_others(stop_others),

``````````

</details>


https://github.com/llvm/llvm-project/pull/230504


More information about the lldb-commits mailing list