I am working on an open source Swift library, which provides types that have a complex internal layout for enhanced performance, copy-on-write behavior and different concrete implementations.
So to make debugging code that uses my library more pleasant, I have written a Python script for LLDB, which provides custom summaries for these types similar to Swift's builtin types like Array or Dictionary. With these type summaries loaded, printing variables or expressions using
frame variable or
expression becomes much more helpful.
The problem that I am facing is that the developer using my library has a suboptimal experience using this Python script because it is hidden in the Swift package (which will be hidden in the .build folder) and has to be manually loaded.
Is there a way to distribute a LLDB python script or an .lldbinit file with a Swift package such that it is loaded automatically as soon as the developer starts debugging in Xcode or trying out stuff with
swift run --repl?
If not, are there any other solutions that would allow the same kind of control over type summaries generated by
frame variable, which are easier to use?