I can't quite tell from the your description, but the first thing to note about 
using lldb for swift is that at present the debug information format for swift 
is the swift module file which is highly dependent on the layout of objects in 
the swift compiler.  So you have to build your binaries using the toolchain you 
built as part of building lldb.  If you are doing this all by hand to play 
around, you can just point at the compiler you've built (the lldb test suite 
does this automatically for all the tests it runs internally.)

Or you can build a swift toolchain and install and use that.

The crucial bit is that you have to use the exact same swift version for 
building and debugging.

Jim


> On Sep 25, 2017, at 9:55 AM, Francis Ricci via swift-lldb-dev 
> <[email protected]> wrote:
> 
> Is swift-lldb only actively supported for debugging xcode projects?
> Swift in general is cross platform (runs on windows, linux, android,
> etc), and I don't generally target iOS or use Xcode. I'd very much
> like to get non-iOS non-Xcode debugging up and running, and I'm
> curious what the current status there is expected to be.
> 
> On Fri, Sep 22, 2017 at 4:28 PM, Greg Clayton <[email protected]> wrote:
>> It adds a BUNCH of command line options to the compile that makes things 
>> work.. So I would suggest building a simple example with it and watching the 
>> compile options and the linker options and all of them are very important... 
>> I gave up on doing manual builds because of this and I let Xcode do it.
>> 
>> At the very least you can have your build system just call "xcodebuild 
>> -configuration Debug" or "xcodebuild -configuration Release".
>> 
>> Try using an Xcode project and see if debugging works.
>> 
>> Greg
>>> On Sep 22, 2017, at 1:24 PM, Francis Ricci <[email protected]> wrote:
>>> 
>>> Nope, was using Ninja. Is Xcode required?
>>> 
>>> On Fri, Sep 22, 2017 at 4:23 PM, Greg Clayton <[email protected]> wrote:
>>>> Are you building your Swift code with Xcode?
>>>> 
>>>>> On Sep 22, 2017, at 12:40 PM, Francis Ricci <[email protected]> 
>>>>> wrote:
>>>>> 
>>>>> This is the message I sent to the list yesterday.
>>>>> 
>>>>> 
>>>>> ---------- Forwarded message ----------
>>>>> From: Francis Ricci <[email protected]>
>>>>> Date: Thu, Sep 21, 2017 at 3:59 PM
>>>>> Subject: swift-lldb release branches
>>>>> To: [email protected]
>>>>> 
>>>>> 
>>>>> Hi all!
>>>>> 
>>>>> I'm getting started doing some development on swift-lldb, and I'm
>>>>> having trouble getting basic debugging functionality out of the lldb
>>>>> binaries I build off of the swift release branches (swift-3.1-branch
>>>>> and swift-4.0-branch). On both branches, when I run lldb against a
>>>>> stdlib unit test binary (tried Stdin.swift and TestDate.swift), even
>>>>> breakpoints don't work. With a swift binary built in debug mode, line
>>>>> number breakpoints don't get set, and function name breakpoints get
>>>>> set but not hit. In release mode, lldb hits an illegal instruction in
>>>>> the test and the test crashes.
>>>>> 
>>>>> I'm building in a pretty vanilla way, just using build-script --lldb
>>>>> on a mac, wondering if I'm missing some important setup (or whether I
>>>>> should be on a different branch). I care about abi stability with a
>>>>> swift compiler built on the release branches, so I don't think I can
>>>>> run off of master or stable.
>>>>> 
>>>>> Francis
>>>> 
>> 
> _______________________________________________
> swift-lldb-dev mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-lldb-dev

_______________________________________________
swift-lldb-dev mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-lldb-dev

Reply via email to