Need help with lldb-vscode plugin

OK, I am back with the resolution for my issue.

Turns out my issue was not related to neither of linked thread, but I found solution in the latter thread. I have uploaded a repo containing my example GitHub - mikolasstuchlik/LldbMinimalTest.

I've tried following steps:

  • Clean the project using swift package clean
  • Build debug using swift build
  • Run my LLDB using /my/path/to/swift/from/swift-org/usr/bin/lldb .build/debug/LldbMinimalTest
  • Add breakpoint using breakpoint set --file main.swift --line 1

If any error ocurred when I set the breakpoint, I've tried another solution.

Turns out, that when target CGLib (which is system module) was added as a dependency directly to the executable target, lldb worked correctly. When I adeed CGLib as a dependency to a Swift target GLib and then added the target GLib as a dependency to the executable target, lldb failed.

I've configured LLDB according to Adrian's post and determined, that my issue was of a different nature than that of the OP of the thread.
Therefore I tried to call swift build with flags for frontend as described by Anthony and this solved my issue.

As I stated in the post above, my error message was exactly the same as yours, maybe the solution is worth trying for you aswell.

I have finalized my solution by addidng swiftSettings: [.unsafeFlags(["-Xfrontend", "-serialize-debugging-options"], .when(configuration: .debug))] argument to the (swift) GLib target which has CGLib as a direct dependency.

Hope this will help :slight_smile: