Skip to content

Commit 58a6cc4

Browse files
Merge pull request #10260 from felipepiovezan/felipe/cherry_pick_filtering_api_update
[cherry-pick][lldb][swift] Adjust language plugin to changes in FilterForLineBreakpoints
2 parents e414fe8 + 9d84136 commit 58a6cc4

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,16 +1852,20 @@ SwiftLanguage::GetDemangledFunctionNameWithoutArguments(Mangled mangled) const {
18521852
return mangled_name;
18531853
}
18541854

1855-
bool SwiftLanguage::IgnoreForLineBreakpoints(const SymbolContext &sc) const {
1856-
// If we don't have a function, conservatively return false.
1857-
if (!sc.function)
1858-
return false;
1859-
llvm::StringRef name =
1860-
sc.function->GetMangled().GetMangledName().GetStringRef();
1861-
// In async functions, ignore await resume ("Q") funclets, these only
1862-
// deallocate the async context and task_switch back to user code.
1863-
return SwiftLanguageRuntime::IsSwiftAsyncAwaitResumePartialFunctionSymbol(
1864-
name);
1855+
void SwiftLanguage::FilterForLineBreakpoints(
1856+
llvm::SmallVectorImpl<SymbolContext> &sc_list) const {
1857+
llvm::erase_if(sc_list, [](const SymbolContext &sc) {
1858+
// If we don't have a function, conservatively keep this sc.
1859+
if (!sc.function)
1860+
return false;
1861+
1862+
// In async functions, ignore await resume ("Q") funclets, these only
1863+
// deallocate the async context and task_switch back to user code.
1864+
llvm::StringRef name =
1865+
sc.function->GetMangled().GetMangledName().GetStringRef();
1866+
return SwiftLanguageRuntime::IsSwiftAsyncAwaitResumePartialFunctionSymbol(
1867+
name);
1868+
});
18651869
}
18661870

18671871
std::optional<bool>

lldb/source/Plugins/Language/Swift/SwiftLanguage.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ class SwiftLanguage : public Language {
9797
llvm::StringRef GetInstanceVariableName() override { return "self"; }
9898

9999
/// Override that skips breakpoints inside await resume ("Q") async funclets.
100-
bool IgnoreForLineBreakpoints(const SymbolContext &sc) const override;
100+
void FilterForLineBreakpoints(
101+
llvm::SmallVectorImpl<SymbolContext> &) const override;
101102

102103
//------------------------------------------------------------------
103104
// PluginInterface protocol

0 commit comments

Comments
 (0)