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

Generate an older version of dwarf on OSX #11848

Closed
wants to merge 1 commit into from

Conversation

alexcrichton
Copy link
Member

OSX apparently doesn't have tooling which understands higher versions of dwarf
by default right now.

Closes #11352

OSX apparently doesn't have tooling which understands higher versions of dwarf
by default right now.

Closes rust-lang#11352
@michaelwoerister
Copy link
Member

👏🐤

@comex
Copy link
Contributor

comex commented Jan 27, 2014

As I described in the issue, clang does this by setting the "Dwarf Version" module flag, and also sets "Debug Info Version", which is required to address a separate issue:

  if (CodeGenOpts.DwarfVersion)
    // We actually want the latest version when there are conflicts.
    // We can change from Warning to Latest if such mode is supported.
    getModule().addModuleFlag(llvm::Module::Warning, "Dwarf Version",
                              CodeGenOpts.DwarfVersion);
  if (DebugInfo)
    // We support a single version in the linked module: error out when
    // modules do not have the same version. We are going to implement dropping
    // debug info when the version number is not up-to-date. Once that is
    // done, the bitcode linker is not going to see modules with different
    // version numbers.
    getModule().addModuleFlag(llvm::Module::Error, "Debug Info Version",
                              llvm::DEBUG_METADATA_VERSION);

Because of the latter, I think it would be better to do the same in Rust, with LLVMAddNamedMetadataOperand, rather than using this patch.

@brson
Copy link
Contributor

brson commented Jan 28, 2014

Does this fix debugging under lldb?

@alexcrichton
Copy link
Member Author

It did for me on OSX, @comex I'm not sure I quite understand the "correct fix", but I'd be more than willing to review a PR that does to the "correct thing"

@alexcrichton
Copy link
Member Author

Closing in favor of #11864

@alexcrichton alexcrichton deleted the osx-debug-info branch January 28, 2014 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extra-debug-info does not appear to work on OSX with lldb
5 participants