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

Emit column info in debuginfo for non msvc like targets #51980

Merged
merged 1 commit into from
Jul 3, 2018

Conversation

est31
Copy link
Member

@est31 est31 commented Jul 2, 2018

Fixes #42921 everywhere except MSVC. This mimics clang behaviour.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 2, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:17:27]    Compiling build_helper v0.1.0 (file:///checkout/src/build_helper)
[00:17:27]    Compiling rustc_codegen_llvm v0.0.0 (file:///checkout/src/librustc_codegen_llvm)
[00:17:27]    Compiling cc v1.0.15
[00:17:28]    Compiling rustc_llvm v0.0.0 (file:///checkout/src/librustc_llvm)
[00:17:35] error[E0425]: cannot find value `cx` in this scope
[00:17:35]   --> librustc_codegen_llvm/debuginfo/source_loc.rs:88:32
[00:17:35]    |
[00:17:35] 88 |             let col_used =  if cx.sess().target.target.options.is_like_msvc {
[00:17:35]    |                                ^^ did you mean `bx`?
[00:17:35] 
[00:17:37] error[E0308]: if and else have incompatible types
[00:17:37]   --> librustc_codegen_llvm/debuginfo/source_loc.rs:88:29
[00:17:37]    |
[00:17:37] 88 |               let col_used =  if cx.sess().target.target.options.is_like_msvc {
[00:17:37]    |  _____________________________^
[00:17:37] 89 | |                 UNKNOWN_COLUMN_NUMBER
[00:17:37] 90 | |             } else {
[00:17:37] 92 | |             };
[00:17:37]    | |_____________^ expected u32, found usize
[00:17:37]    |
[00:17:37]    = note: expected type `u32`
[00:17:37]    = note: expected type `u32`
[00:17:37]               found type `usize`
[00:17:37] 
eps/librustc_errors-e036f8f5b9204e52.so --extern rustc_incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_incremental-4c6197a9c6b06d9c.so --extern rustc_llvm=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_llvm-42e74c2f020e6a01.rlib --extern rustc_mir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_mir-8fc603afb8ea9b13.so --extern rustc_platform_intrinsics=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_platform_intrinsics-06dc5f95410eaad9.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-066098b54e835a1f.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-05774896829b5d87.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-05774896829b5d87.rlib --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-a1b02e0d020520ac.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-f36f6cb494d373be.so --extern tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libtempfile-a2c79048744e2ad8.rlib -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-ea5907e223517cf2/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-a59a4023b81a89b2/out -L native=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-c4b130070c8b640c/out -L native=/usr/lib/llvm-3.9/lib` (exit code: 101)
68792 ./src/llvm/lib
65412 ./src/llvm-emscripten/test/CodeGen
61228 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc
60840 ./src/llvm-emscripten/lib

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@eddyb
Copy link
Member

eddyb commented Jul 2, 2018

r? @michaelwoerister cc @alexcrichton

@alexcrichton
Copy link
Member

Could a test be added for this?

@est31
Copy link
Member Author

est31 commented Jul 2, 2018

@alexcrichton no idea how to get tests out of this using lldb or gdb, which the debuginfo tests rely on. The only place lldb exposes column info that I am aware of is in underlining the column: https://reviews.llvm.org/rL282105

I could create something using gimli/addr2line but not sure if we want to add it for the test harness just for that :).

@est31
Copy link
Member Author

est31 commented Jul 2, 2018

Note that this underlining happens using ANSI control characters. It's not like rustc's span rendering.

@alexcrichton
Copy link
Member

@bors: r+

Ok in that case seems fine to leave this as-is

@bors
Copy link
Contributor

bors commented Jul 2, 2018

📌 Commit 3779a4c has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 2, 2018
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Jul 3, 2018
Emit column info in debuginfo for non msvc like targets

Fixes rust-lang#42921 everywhere except MSVC. This mimics clang behaviour.
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Jul 3, 2018
Emit column info in debuginfo for non msvc like targets

Fixes rust-lang#42921 everywhere except MSVC. This mimics clang behaviour.
bors added a commit that referenced this pull request Jul 3, 2018
Rollup of 13 pull requests

Successful merges:

 - #51548 (Initialize LLVM's AMDGPU target machine, if available.)
 - #51809 (Add read_exact_at and write_all_at methods to FileExt on unix)
 - #51914 (add outlives annotations to `BTreeMap`)
 - #51958 (Show known meta items in unknown meta items error)
 - #51973 (Make Stdio handle UnwindSafe)
 - #51977 (bootstrap: tests should use rustc from config.toml)
 - #51978 (Do not suggest changes to str literal if it isn't one)
 - #51979 (Get rid of `TyImplTraitExistential`)
 - #51980 (Emit column info in debuginfo for non msvc like targets)
 - #51982 (incr.comp.: Take names of children into account when computing the ICH of a module's HIR.)
 - #51997 (add entry for cargo-metadata feature to RELEASES)
 - #52004 (toolstate: Fixed detection of changed submodule, and other fixes.)
 - #52006 ( Change --keep-stage to apply more often)

Failed merges:

r? @ghost
@bors bors merged commit 3779a4c into rust-lang:master Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants