Debugging Improvements in Swift 5.9

Swift 5.9 introduced a number of new debugging features to the compiler and LLDB debugger. Here are three changes that can help with your everyday debugging workflows.

swift.org/blog/whats-new-swift-debugging-5.9/

Swift 5.9 enhances debugging with three key improvements to the compiler and LLDB. The p and po commands now use the faster dwim-print command, avoiding persistent result variables and enabling po to print Swift objects from raw addresses.

LLDB supports generic type parameters in expressions, allowing type-specific breakpoint conditions, such as stopping only when a generic type is a specific concrete type.

The compiler now emits more precise lexical scope information, ensuring variables like a in a function are only visible in the debugger after initialisation, preventing display of uninitialised memory.


Category:

Tag:

Year: