Skip to content

debuginfo: Instruct MSVC linker to generate PDB file if debuginfo is enabled #26993

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

Merged
merged 1 commit into from
Jul 13, 2015

Conversation

michaelwoerister
Copy link
Member

This PR will enable RUSTC to generate PDB debuginfo files when targeting the MSVC toolchain. Mind that these are not full featured PDB files -- they just contain line tables, so you can get proper backtraces and step through your code, but variable values can't be inspected. We are just levering (LLVM's current support)[http://clang.llvm.org/docs/MSVCCompatibility.html] for creating Windows debuginfo. When LLVM's support gets better, we should benefit from that too without much effort.

I also wanted to include some kind of auto test with this PR but I could not get the rmake tests to work properly when targeting MSVC.

EDIT:
Closes #19533

@rust-highfive
Copy link
Contributor

r? @arielb1

(rust_highfive has picked a reviewer for you, use r? to override)

@michaelwoerister
Copy link
Member Author

Oops, trailing whitespace in there. I'll fix it asap.

@michaelwoerister
Copy link
Member Author

OK, should be fixed now.

@alexcrichton
Copy link
Member

Is there a downside to just always passing /DEBUG to the linker? For example if we're linking native libraries with debuginfo into a Rust library with not debuginfo, perhaps it'd be good to pass the flag through?

@retep998
Copy link
Member

Passing /DEBUG disables /OPT by default, although if Rust explicitly specifies /OPT (which it does) that will take precedence.

@alexcrichton
Copy link
Member

@bors: r+ 6c70127

Ah ok, sounds like we definitely shouldn't be passing by default then.

@alexcrichton alexcrichton assigned alexcrichton and unassigned arielb1 Jul 13, 2015
@michaelwoerister
Copy link
Member Author

/DEBUG also implies /INCREMENTAL which leads to larger binaries because of additional padding.

bors added a commit that referenced this pull request Jul 13, 2015
This PR will enable RUSTC to generate PDB debuginfo files when targeting the MSVC toolchain. Mind that these are not full featured PDB files -- they just contain line tables, so you can get proper backtraces and step through your code, but variable values can't be inspected. We are just levering (LLVM's current support)[http://clang.llvm.org/docs/MSVCCompatibility.html] for creating Windows debuginfo. When LLVM's support gets better, we should benefit from that too without much effort.

I also wanted to include some kind of auto test with this PR but I could not get the `rmake` tests to work properly when targeting MSVC.

EDIT:
Closes #19533
@bors
Copy link
Collaborator

bors commented Jul 13, 2015

⌛ Testing commit 6c70127 with merge 2533a85...

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.

6 participants