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-2764] LLDB fails to to import a Clang module imported into Swift #4586

Closed
swift-ci opened this issue Sep 26, 2016 · 5 comments
Closed

[SR-2764] LLDB fails to to import a Clang module imported into Swift #4586

swift-ci opened this issue Sep 26, 2016 · 5 comments
Labels
bug Something isn't working LLDB for Swift

Comments

@swift-ci
Copy link

Previous ID SR-2764
Radar None
Original Reporter dmishe (JIRA User)
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
Target: x86_64-apple-macosx10.9

Additional Detail from JIRA
Votes 1
Component/s LLDB for Swift
Labels Bug
Assignee None
Priority Medium

md5: 4e80e0f98f6325462d3732d4035ae6d8

relates to:

  • SR-3169 lldb stops working when C module includes a header outside of module's include/ dir

Issue Description:

When a Clang module (CModule) is imported into Swift code (module Foo), that is then used by C code. LLDB is able to find Foo in dSYM, but fails to import the CModule module.

If you run build.sh in the attached sample, you will see:

warning: Swift error in module main.
Debug info from this module will be unavailable in the debugger.

error: in auto-import:
failed to get module 'Foo' from AST context:
error: missing required module 'CModule'

The program itself runs just fine:

$ out/main
2016-09-26 18:36:45.065 main[87591:4787892] Hello, World!
2016-09-26 18:36:45.066 main[87591:4787892] Foo = <CModule: 0x7fdbfa6002c0>

Clearly I am not telling the compiler enough for it to be able to reconstruct the context afterwards. But I am not sure what is missing.

@swift-ci
Copy link
Author

Comment by Dmitry Shevchenko (JIRA)

@trfiala, this might be related to https://bugs.swift.org/browse/SR-2637

@trfiala
Copy link
Mannequin

trfiala mannequin commented Sep 29, 2016

dmishe (JIRA User), hmm not sure. Have you tried this with a macOS package that includes the fix that went in SR-2637? Do you get the same behavior? The swift-lldb master branch is now quite a bit ahead of the swift 3.0 release's corresponding LLDB, and includes the SR-2637 change, so there is certainly potential for lookups to be handled differently given all the changes that came in from LLVM.org LLDB.

@swift-ci
Copy link
Author

Comment by Dmitry Shevchenko (JIRA)

Reproduces on swift-DEVELOPMENT-SNAPSHOT-2016-09-27-a.xctoolchain. I suppose it's not that related.

@swift-ci
Copy link
Author

Comment by Dmitry Shevchenko (JIRA)

@trfiala what is the canonical way for LLDB to discover and load Clang modules? I would like to debug this issue some more and some pointers would be really helpful.

@swift-ci
Copy link
Author

swift-ci commented Jan 5, 2017

Comment by Dmitry Shevchenko (JIRA)

After some poking at this, it looks like I was missing debug info in .swiftmodule, adding

 -Xfrontend -serialize-debugging-options

Fixes the issue.

@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 LLDB for Swift
Projects
None yet
Development

No branches or pull requests

1 participant