How to print async properties in LLDB?

1 week ago 12
ARTICLE AD BOX

I would do

(lldb) po Task { print(await maximumDistanceForTrailingHandle) }

You will need to resume the program to see the print output. This is because Swift tasks are just jobs submitted to a task executor, which is obviously not running when the whole program is paused.

It seems like LLDB doesn't do much strict concurrency checking - it doesn't give you an error for the above code, even if the implicitly-captured self is not Sendable.

Related Swift Forums post: https://forums.swift.org/t/who-knows-how-to-call-swift-await-async-function-in-xcode-debugger/63475/3

Read Entire Article