[swift-build-dev] Cannot debug SwiftPM package in Xcode

Ryan Lovelett swift-dev at ryan.lovelett.me
Sun Nov 13 10:39:04 CST 2016

On Fri, Nov 11, 2016, at 08:33 PM, Jim Ingham wrote:
> There's a bug in the code that's supposed to dump the error message when
> we can't reconstitute a module which cause the error not to get printed. 
> You can work around that to get lldb to show you the error by setting the
> environment variable LLDB_SWIFT_DUMP_DIAGS, and then running lldb with
> that set.  Then you should get you whatever error was causing the clang
> importer used by lldb to fall over.


Thanks for that pointer. The behavior is even stranger now. When I run
Xcode with that environment variable set the debugger ends up kind of
working. The "auto" variables still do not show up in Xcode but when I
print from lldb (e.g., `po r`) it actually dumps the object information.
If I close and re-run Xcode without the environment variable it goes
back to printing those errors and I get nothing. ¯\_(ツ)_/¯

I've attached the log output from Xcode when running with this variable
to this email. I do not think the logs are germane to this issue. I
think they are just Xcode general layout diagnostics.

Obviously there is still something wrong since the "auto" variables
still are not populating and all the types report as `<<error type>>`.

BUT I now have a work-around and I can at least dump the variables from

Thank you for the suggestion!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lldb.log
Type: application/octet-stream
Size: 1853 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-build-dev/attachments/20161113/b36d894c/attachment.obj>

More information about the swift-build-dev mailing list