Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6033] llvm-dsymutil does not include swiftmodule files in macho debug map #4504

Closed
swift-ci opened this issue Sep 29, 2017 · 7 comments
Closed
Labels
bug Something isn't working Compiler LLDB for Swift

Comments

@swift-ci
Copy link

Previous ID SR-6033
Radar rdar://problem/34768588
Original Reporter fjricci (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

macOS 10.12

Additional Detail from JIRA
Votes 0
Component/s Compiler, LLDB for Swift
Labels Bug
Assignee fjricci (JIRA)
Priority Medium

md5: 0d179555e62cfadb4ec9b86b94f434bb

Issue Description:

The system dsymutil (from Xcode) pulls swiftmodule files into the macho debug map, but llvm-dsymutil does not (I tried with upstream/master, swift-llvm, and upstream/release_40). To reproduce:

$ cat /tmp/test.swift

let x = 42

print("x = (x)")

$ swiftc /tmp/test.swift -g -Onone -sdk "/Applications/Xcode_9.0.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk" -o /tmp/test -save-temps
$ llvm-dsymutil /tmp/test -dump-debug-map
$ "/Applications/Xcode_9.0.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil" /tmp/test -dump-debug-map

Notice that the swiftmodule file appears in the debug map when xcode is used, but not when llvm-dsymutil is used. This failure causes an inability to debug (for example printing the value of x) with lldb if llvm-dsymutil is used.

@belkadan
Copy link

belkadan commented Oct 2, 2017

cc @adrian-prantl

@adrian-prantl
Copy link
Member

@swift-ci create

@swift-ci
Copy link
Author

swift-ci commented Oct 2, 2017

Comment by Francis Ricci (JIRA)

Looks to me like the swiftmodule just needs to be dumped into the DWARF __swift_ast section (a hexdump of my test swiftmodule exactly matches the contents of that section as created by xcode's dsymutil). Working on that currently.

@swift-ci
Copy link
Author

swift-ci commented Oct 2, 2017

Comment by Francis Ricci (JIRA)

Probably belongs in a separate bug, but I also noticed several apple_* sections are missing with llvm_dsymutil as well:

__DWARF.__apple_names
__DWARF.__apple_namespac
__DWARF.__apple_types
__DWARF.__apple_objc

@swift-ci
Copy link
Author

swift-ci commented Oct 2, 2017

Comment by Francis Ricci (JIRA)

apple/swift-llvm#61

@swift-ci
Copy link
Author

swift-ci commented Oct 3, 2017

Comment by Francis Ricci (JIRA)

Migrated this to upstream llvm - https://reviews.llvm.org/D38504

@swift-ci
Copy link
Author

swift-ci commented Oct 6, 2017

Comment by Francis Ricci (JIRA)

Committed llvm revision as r315066.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 7, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Compiler LLDB for Swift
Projects
None yet
Development

No branches or pull requests

3 participants