[Lldb-commits] [lldb] [lldb] Skip the prologue before reading `this` when stepping into std::function (PR #209629)

Felipe de Azevedo Piovezan via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 15 06:53:02 PDT 2026


================
@@ -470,6 +470,21 @@ CPPLanguageRuntime::GetStepThroughTrampolinePlan(Thread &thread,
   StackFrameSP frame = thread.GetStackFrameAtIndex(0);
 
   if (frame) {
+    // Advance past the prologue if we stopped there.
+    Address func_start_address =
+        sc.function ? sc.function->GetAddress() : symbol->GetAddress();
+    lldb::addr_t func_start =
+        func_start_address.GetLoadAddress(target_sp.get());
+    if (func_start != LLDB_INVALID_ADDRESS && func_start == curr_pc) {
----------------
felipepiovezan wrote:

While `func_start == curr_pc` is probably fine, the more accurate check is `curr_pc < func_start + prologue_size`.

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


More information about the lldb-commits mailing list