Uploaded image for project: 'Swift'
  1. Swift
  2. SR-3200

Cannot debug SwiftPM package in Xcode

    XMLWordPrintable

    Details

      Description

      I've been trying to debug a program that is packaged/built with SwiftPM. Unfortunately, the Xcode project generated via swift package generate-xcodeproj cannot inspect the variables. Whenever I try to print an object from the lldb command-line in Xcode I get this error:

      po r
      warning: Swift error in module example.
      Debug info from this module will be unavailable in the debugger.
      
      warning: Swift error in module SourceKittenFramework.
      Debug info from this module will be unavailable in the debugger.
      
      error: in auto-import:
      failed to get module 'example' from AST context:
      

      I've narrowed it down to a specific dependency, SourceKittenFramework, but I'm not sure if it is a bug in SwiftPM or in the package configuration or something else completely.

      I've attached a minimal SwiftPM package ($ tar xvf cannot-debug.tar.xz) that should generate an Xcode project that exemplifies the issue.

        Attachments

        1. cannot-debug.tar.xz
          0.6 kB
        2. foo.zip
          20 kB

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              rlovelett Ryan Lovelett
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: