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

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

Merged
merged 1 commit into from Jul 13, 2015

Conversation

Projects
None yet
6 participants
@michaelwoerister
Copy link
Contributor

michaelwoerister commented Jul 12, 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

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Jul 12, 2015

r? @arielb1

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

@michaelwoerister

This comment has been minimized.

Copy link
Contributor Author

michaelwoerister commented Jul 12, 2015

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

@michaelwoerister michaelwoerister force-pushed the michaelwoerister:msvc-debuginfo branch from 03a4948 to 6c70127 Jul 12, 2015

@michaelwoerister

This comment has been minimized.

Copy link
Contributor Author

michaelwoerister commented Jul 12, 2015

OK, should be fixed now.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 12, 2015

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

This comment has been minimized.

Copy link
Member

retep998 commented Jul 12, 2015

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

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Jul 13, 2015

@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

This comment has been minimized.

Copy link
Contributor Author

michaelwoerister commented Jul 13, 2015

/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

Auto merge of #26993 - michaelwoerister:msvc-debuginfo, r=alexcrichton
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

This comment has been minimized.

Copy link
Contributor

bors commented Jul 13, 2015

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

@bors bors merged commit 6c70127 into rust-lang:master Jul 13, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.