diff --git a/lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp b/lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp index 832187bc45e79..27098878430d4 100644 --- a/lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp +++ b/lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp @@ -1852,16 +1852,20 @@ SwiftLanguage::GetDemangledFunctionNameWithoutArguments(Mangled mangled) const { return mangled_name; } -bool SwiftLanguage::IgnoreForLineBreakpoints(const SymbolContext &sc) const { - // If we don't have a function, conservatively return false. - if (!sc.function) - return false; - llvm::StringRef name = - sc.function->GetMangled().GetMangledName().GetStringRef(); - // In async functions, ignore await resume ("Q") funclets, these only - // deallocate the async context and task_switch back to user code. - return SwiftLanguageRuntime::IsSwiftAsyncAwaitResumePartialFunctionSymbol( - name); +void SwiftLanguage::FilterForLineBreakpoints( + llvm::SmallVectorImpl &sc_list) const { + llvm::erase_if(sc_list, [](const SymbolContext &sc) { + // If we don't have a function, conservatively keep this sc. + if (!sc.function) + return false; + + // In async functions, ignore await resume ("Q") funclets, these only + // deallocate the async context and task_switch back to user code. + llvm::StringRef name = + sc.function->GetMangled().GetMangledName().GetStringRef(); + return SwiftLanguageRuntime::IsSwiftAsyncAwaitResumePartialFunctionSymbol( + name); + }); } std::optional diff --git a/lldb/source/Plugins/Language/Swift/SwiftLanguage.h b/lldb/source/Plugins/Language/Swift/SwiftLanguage.h index 191a03ccf1712..b6da165402b5e 100644 --- a/lldb/source/Plugins/Language/Swift/SwiftLanguage.h +++ b/lldb/source/Plugins/Language/Swift/SwiftLanguage.h @@ -97,7 +97,8 @@ class SwiftLanguage : public Language { llvm::StringRef GetInstanceVariableName() override { return "self"; } /// Override that skips breakpoints inside await resume ("Q") async funclets. - bool IgnoreForLineBreakpoints(const SymbolContext &sc) const override; + void FilterForLineBreakpoints( + llvm::SmallVectorImpl &) const override; //------------------------------------------------------------------ // PluginInterface protocol