[all-commits] [llvm/llvm-project] c0f093: [lldb] Fix ThreadPlanStepOut::DoPlanExplainsStop i...

Felipe de Azevedo Piovezan via All-commits all-commits at lists.llvm.org
Wed Dec 3 02:51:49 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c0f0936f5a47270d47486f6d5860b5f8e30e0e32
      https://github.com/llvm/llvm-project/commit/c0f0936f5a47270d47486f6d5860b5f8e30e0e32
  Author: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
  Date:   2025-12-03 (Wed, 03 Dec 2025)

  Changed paths:
    M lldb/include/lldb/Breakpoint/BreakpointSite.h
    M lldb/source/Breakpoint/BreakpointSite.cpp
    M lldb/source/Target/ThreadPlanStepOut.cpp

  Log Message:
  -----------
  [lldb] Fix ThreadPlanStepOut::DoPlanExplainsStop inspection of BreakpointSite (#169799)

Suppose two threads are performing the exact same step out plan. They
will both have an internal breakpoint set at their parent frame. Now
supposed both of those breakpoints are in the same address (i.e. the
same BreakpointSite).

At the end of `ThreadPlanStepOut::DoPlanExplainsStop`, we see this:

```
// If there was only one owner, then we're done.  But if we also hit
// some user breakpoint on our way out, we should mark ourselves as
// done, but also not claim to explain the stop, since it is more
// important to report the user breakpoint than the step out
// completion.

if (site_sp->GetNumberOfConstituents() == 1)
  return true;
```

In other words, the plan looks at the name number of constituents of the
site to decide whether it explains the stop, the logic being that a
_user_ might have put a breakpoint there. However, the implementation is
not correct; in particular, it will fail in the situation described
above. We should only care about non-internal breakpoints that would
stop for the current thread.

It is tricky to test this, as it depends on the timing of threads, but I
was able to consistently reproduce the issue with a swift program using
concurrency.

rdar://165481473



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list