8000 🍒[lldb][swift] Disable breakpoint filtering by default by felipepiovezan · Pull Request #10886 · swiftlang/llvm-project · GitHub
[go: up one dir, main page]

Skip to content

🍒[lldb][swift] Disable breakpoint filtering by default #10886

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

felipepiovezan
Copy link

A previous patch had introduced the notion of Language breakpoint filtering when setting line breakpoints. While this is generally a good idea, the swift implementation was motivated by statements like this:

async let x = ...
await foo()
await x

All of these lines have many different breakpoint locations associated with them, creating many pauses while stepping; the intent behind the filtering was to provide a smoother stepping experience.

The implementation filters breakpoints by "funclet" numbers, disabling all but the lowest such funclet. Unfortunately, this fails when the CFG of an async funclet needs to be cloned in non-trivial ways. For example:

func foo(_ argument: Int) async {
  do {
    switch argument {
    case 1:
      try await willthrow(1)
    case 2:
      try await willthrow(2)
    default:
      return
    }
  } catch {
    print("breakhere")
  }
}

The breakpoint in "breakhere" has two funclets associated with it, one when we throw from case 1, one from case 2. Filtering is incorrect in this situation.

This patch disables filtering until we can solve this at a compiler level. While we are disabling this through the TargetProperties setting, which could affect other languages, Swift is the only such language using that setting.

(cherry picked from commit 77290cc)

A previous patch had introduced the notion of Language breakpoint
filtering when setting line breakpoints. While this is generally a good
idea, the swift implementation was motivated by statements like this:

```
async let x = ...
await foo()
await x
```

All of these lines have many different breakpoint locations associated
with them, creating many pauses while stepping; the intent behind the
filtering was to provide a smoother stepping experience.

The implementation filters breakpoints by "funclet" numbers,
disabling all but the lowest such funclet. Unfortunately, this fails
when the CFG of an async funclet needs to be cloned in non-trivial ways.
For example:

```
func foo(_ argument: Int) async {
  do {
    switch argument {
    case 1:
      try await willthrow(1)
    case 2:
      try await willthrow(2)
    default:
      return
    }
  } catch {
    print("breakhere")
  }
}
```

The breakpoint in "breakhere" has two funclets associated with it, one
when we throw from case 1, one from case 2. Filtering is incorrect in
this situation.

This patch disables filtering until we can solve this at a compiler
level. While we are disabling this through the TargetProperties setting,
which could affect other languages, Swift is the only such language
using that setting.

(cherry picked from commit 77290cc)
@felipepiovezan felipepiovezan merged commit 971f991 into swiftlang:next Jun 23, 2025
@felipepiovezan felipepiovezan deleted the felipe/cherry_pick_bp_filtering branch June 23, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0