<div dir="ltr">Hello,<div><br></div><div>We build Swift code in a location different from where sources live and having a bunch of issues with LLDB in such a setup.</div><div><br></div><div>One of the problems is LLDB not being able to import the modules referenced from binaries we build:</div><div><div>error: Error in auto-import:</div><div>failed to get module '<module name>' from AST context</div></div><div><br></div><div>It looks like LLDB gets module search paths from a few sources:</div><div><br></div><div>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.</div><div><br></div><div>2. There's theĀ <span style="line-height:1.5">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Ā </span><a href="https://github.com/apple/swift-lldb/blob/master/source/Symbol/SwiftASTContext.cpp#L2009">https://github.com/apple/swift-lldb/blob/master/source/Symbol/SwiftASTContext.cpp#L2009</a>. Is that a bug or intentional?</div><div><br></div><div>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?</div>
<div><br></div><div><br></div></div>