-
Notifications
You must be signed in to change notification settings - Fork 246
Swift
vadimcn edited this page Sep 7, 2021
·
1 revision
The default LLDB backend bundled with CodeLLDB supports C, C++, Rust, as well as many other languages whose debug info is compatible with C++, however this list does not include Swift. It appears that Swift has diverged far enough from C++ that LLDB cannot interpret its debug info without a special Swift plugin.
It is, however, still possible to debug Swift programs using CodeLLDB by directing it to use an alternate debugger backend, namely, the one provided with the Swift toolchain:
- Open VSCode commands palette and search for "LLDB: Use Alternate Backend..." command.
- At the prompt, enter executable name of the LLDB instance you want to use. On MacOS, you should use the default system instance (i.e. just
lldb
). On Linux, look forlldb
in<swift install root>/usr/bin
directory. - If all goes well, CodeLLDB should report that it has located the library it needs and ask for your confirmation, after which it will add
lldb.library
configuration setting in the current workspace. If auto-detection does not work, you can also locateliblldb...so/dylib/dll
manually.