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

[LLVM 4.0] Incomplete debuginfo for globals. #40580

Closed
TimNN opened this issue Mar 16, 2017 · 0 comments
Closed

[LLVM 4.0] Incomplete debuginfo for globals. #40580

TimNN opened this issue Mar 16, 2017 · 0 comments

Comments

@TimNN
Copy link
Contributor

TimNN commented Mar 16, 2017

Issue: gdb shows globals as <optimized out> when a rust program is compiled with llvm 4.0.

Test program:

static mut I64: i64 = -64;

 fn main() {
     _zzz();

     let _a = unsafe { I64 };
 }

 fn _zzz() {()}

Compiling with rust + LLVM 4.0 produces this IR, excerpts:

@_ZN5globt3I6417h1343cea697c2f8f6E = internal global i64 -64, align 8

!6 = !DIGlobalVariableExpression(var: !7)
!7 = distinct !DIGlobalVariable(name: "I64", linkageName: "_ZN5globt3I64E", scope: !8, file: !9, line: 1, type: !10, isLocal: true, isDefinition: true, align: 8)

From looking at the clang 4.0 output of a similar program, I have determined that the static definition (excerpt line 1) is missing a , !dbg !6. The addition of such a !dbg fixed the issue, as verified by manually editing the IR and compiling with llc.

cc @michaelwoerister, @dylanmckay

If someone can point me in the right direction, where / what functions should be called, I can try to fix this (I can also test any potential patches).

Edit: Also feel free to ping me on IRC.

frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 17, 2017
[LLVM 4.0] Add missing debuginfo metadata to globals

Fixes rust-lang#40580.

cc @rkruppe
cc rust-lang#40123
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 18, 2017
[LLVM 4.0] Add missing debuginfo metadata to globals

Fixes rust-lang#40580.

cc @rkruppe
cc rust-lang#40123
arielb1 pushed a commit to arielb1/rust that referenced this issue Mar 18, 2017
[LLVM 4.0] Add missing debuginfo metadata to globals

Fixes rust-lang#40580.

cc @rkruppe
cc rust-lang#40123
arielb1 pushed a commit to arielb1/rust that referenced this issue Mar 19, 2017
[LLVM 4.0] Add missing debuginfo metadata to globals

Fixes rust-lang#40580.

cc @rkruppe
cc rust-lang#40123
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 20, 2017
[LLVM 4.0] Add missing debuginfo metadata to globals

Fixes rust-lang#40580.

cc @rkruppe
cc rust-lang#40123
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

No branches or pull requests

1 participant