Entries in call stack for Swift async functions starts with “await resume partial function for”
OS: macOS 14.0 VSCode version: 1.84.2 CodeLLDB version: 1.10.0 Compiler: swift-DEVELOPMENT-SNAPSHOT-2023-11-13-a from swift.org Debuggee: A Swift executable
When debugging a Swift executable every async function in the call stack is prefixed with “await resume partial function for”, which takes up valuable space in the call stack view without providing too much value. It would be easier to read the stack traces if that prefix wasn’t there and the entry just included the function’s name (e.g. main() in the screenshot).
Steps to Reproduce
- Create a new Swift package using
mkdir /tmp/pck; cd /tmp/pck; swift package init --type executable - Change
main.swiftto
func printHelloWorld() async {
print("hello world")
}
func main() async {
await printHelloWorld()
}
await main()
- Open
/tmp/pckin VS Code - Install the Swift extension
- Set a breakpoint on line 2
print("hello world") - Debug the
pckexecutable
It's the function name that swift-lldb (you are loading a custom liblldb, right?) returns for the stack frame. Codelldb just passes that through...
Just to note when running swift lldb outside of VSCode and calling thread backtrace the call stack does not include this text.
I'm not sure how they generate this and how it is different to CodeLLDB.