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

Disabling -serialize-debugging-options breaks lldb Swift type loading

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Component/s: LLDB for Swift
    • Labels:
      None

      Description

      In order to use a build cache, we need to disable -serialize-debugging-options. Doing this prevents host specific paths from being embedded in .swiftmodule files.

      However, disabling this breaks lldb's Swift AST resolution logic (I think). Specifically, Swift types, for example String, and Dictionary, are not resolved. This breaks expression evaluation and also printing values via frame variable.

      Attached is a sample Xcode project. It has an xcconfig that sets two build settings:

      SWIFT_SERIALIZE_DEBUGGING_OPTIONS = NO
      OTHER_SWIFT_FLAGS = -Xfrontend -no-serialize-debugging-options
      

      The first one tells Xcode to not add -Xfrontend -serialize-debugging-options.

      The second one tells swiftc to always disable serialized debugging options. Without this flag, any module with a main entry point will automatically contain serialized debugging options.

      The Xcode project has a breakpoint in the app delegate, that prints the launchOptions argument. The output is:

      (lldb) p launchOptions
      error: <EXPR>:3:1: error: use of unresolved identifier 'launchOptions'
      launchOptions
      ^~~~~~~~~~~~~
      

        Attachments

          Activity

            People

            Assignee:
            aprantl Adrian Prantl
            Reporter:
            kastiglione Dave Lee
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: