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

Package manager should link main swiftmodule in executables

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Package Manager
    • Labels:
      None

      Description

      Upon creation of empty packgage of type --executable when I build the package via swift build. I receive a binary that works, but isn't debuggable.

      lldb .build/debug/lldb-test

      (lldb) target create ".build/debug/lldb-test"
      Current executable set to '.build/debug/lldb-test' (x86_64).
      (lldb) breakpoint set -f main.swift -l 3
      Breakpoint 1: where = lldb-test`main + 81 at main.swift:3, address = 0x0000000000400e81
      (lldb) r
      Process 30195 launched: '/home/janpaul/src/lldb-test/.build/debug/lldb-test' (x86_64)
      Process 30195 stopped

      • thread #1: tid = 30195, 0x0000000000400e81 lldb-test`main + 81 at main.swift:3, name = 'lldb-test', stop reason = breakpoint 1.1
        frame #0: 0x0000000000400e81 lldb-test`main + 81 at main.swift:3
        1 import Foundation
        2
        -> 3 let swifty="Swift is cool"
        4
        5 print(swifty)
        6
        7 exit(0)
        (lldb) n
        Process 30195 stopped
      • thread #1: tid = 30195, 0x0000000000400ea4 lldb-test`main + 116 at main.swift:5, name = 'lldb-test', stop reason = step over
        frame #0: 0x0000000000400ea4 lldb-test`main + 116 at main.swift:5
        2
        3 let swifty="Swift is cool"
        4
        -> 5 print(swifty)
        6
        7 exit(0)
        (lldb) po swifty
        error: in auto-import:
        failed to get module 'lldb_test' from AST context

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aciid Ankit Aggarwal
              Reporter:
              nerakhon Jan Paul
              Votes:
              5 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated: