[swift-users] LLDB module import paths

Dmitry Shevchenko dmishe at google.com
Mon Aug 22 16:08:13 CDT 2016


Hello,

We build Swift code in a location different from where sources live and
having a bunch of issues with LLDB in such a setup.

One of the problems is LLDB not being able to import the modules referenced
from binaries we build:
error: Error in auto-import:
failed to get module '<module name>' from AST context

It looks like LLDB gets module search paths from a few sources:

1. The compiler command line stored into DWARF. We could add a -I flag
here, like SPM does, but our paths are all relative. And Xcode starts LLDB
with CWD = /. This does not work in principle.

2. There's the target.swift-module-search-paths setting. But it does not
work in my experimentation, I suspect this is because it feeds into
framework search paths, as evidenced here
https://github.com/apple/swift-lldb/blob/master/source/Symbol/SwiftASTContext.cpp#L2009.
Is that a bug or intentional?

3. Anything else? Is there a flag similar to -compilation-dir flag on GDB
that would root all of the relative paths found in DWARF/modules to a
specific path?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160822/3d515695/attachment.html>


More information about the swift-users mailing list