Skip to content

[lldb] Exclude "resume partial" prefix from demangled display name #2872

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
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
1 change: 1 addition & 0 deletions lldb/source/Target/SwiftLanguageRuntimeNames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ SwiftLanguageRuntime::DemangleSymbolAsString(StringRef symbol, DemangleMode mode
switch (mode) {
case eSimplified:
options = swift::Demangle::DemangleOptions::SimplifiedUIDemangleOptions();
options.ShowAsyncResumePartial = false;
break;
case eTypeName:
options.DisplayModuleNames = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def test(self):
# Run until the next `await` breakpoint.
process.Continue()
elif stop_reason == lldb.eStopReasonBreakpoint:
caller_before = thread().frames[0].function.name
caller_before = thread().frames[0].function.GetDisplayName()
line_before = thread().frames[0].line_entry.line
thread().StepInto()
caller_after = thread().frames[1].function.name
caller_after = thread().frames[1].function.GetDisplayName()
line_after = thread().frames[0].line_entry.line

# Breakpoints on lines with an `await` may result in more than
Expand All @@ -54,10 +54,7 @@ def test(self):
process.Continue()
continue

# The entry function is missing this prefix dedicating resume functions.
prefix = re.compile(r'^\([0-9]+\) (await|suspend) resume partial function for ')
self.assertEqual(prefix.sub('', caller_after),
prefix.sub('', caller_before))
self.assertEqual(caller_after, caller_before)
num_async_steps += 1

self.assertGreater(num_async_steps, 0)