Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<SymbolContext> &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<bool>
Expand Down
3 changes: 2 additions & 1 deletion lldb/source/Plugins/Language/Swift/SwiftLanguage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<SymbolContext> &) const override;

//------------------------------------------------------------------
// PluginInterface protocol
Expand Down