Skip to content

[SR-11485] Disabling -serialize-debugging-options breaks lldb Swift type loading #4481

Open
@kastiglione

Description

@kastiglione
Previous ID SR-11485
Radar rdar://problem/55479258
Original Reporter @kastiglione
Type Bug
Status Reopened
Resolution

Attachment: Download

Additional Detail from JIRA
Votes 1
Component/s LLDB for Swift
Labels Bug
Assignee @adrian-prantl
Priority Medium

md5: 66acdb4bc404bab42d7edf30fe14da67

Issue 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
^~~~~~~~~~~~~

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions