Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upLine-based breakpoints in inline functions don't show correct source #13442
Comments
jdm
added
the
A-debuginfo
label
Apr 10, 2014
This comment has been minimized.
This comment has been minimized.
|
Taking some notes here:
|
This comment has been minimized.
This comment has been minimized.
|
Interesting, the unoptimized IR of the above program does not even contain a function ; Function Attrs: uwtable
define internal void @_ZN4main20h4bedfa0b9eaa7039jaaE() unnamed_addr #0 {
entry-block:
%0 = alloca i32
%let = alloca i32
store i32 5, i32* %0, !dbg !18 ; <=== no function call
%1 = load i32* %0, !dbg !18
store i32 %1, i32* %let
ret void, !dbg !20
} |
This comment has been minimized.
This comment has been minimized.
|
Maybe |
This comment has been minimized.
This comment has been minimized.
|
Yeah, I need to find out where this inlining happens. Do we do it? Does LLVM do it? |
This comment has been minimized.
This comment has been minimized.
|
Try looking at the .0.noopt.bc file produced by -C save-temps instead
|
This comment has been minimized.
This comment has been minimized.
|
@dotdash Good tip! ; Function Attrs: alwaysinline uwtable
define internal i64 @_ZN3bar20h4b0789288b21a387eaaE() unnamed_addr #0 {
entry-block:
ret i64 5, !dbg !19
}
; Function Attrs: uwtable
define internal void @_ZN4main20h0007eb42fb7e75b0jaaE() unnamed_addr #1 {
entry-block:
%0 = alloca i64
%let = alloca i64
%1 = call i64 @_ZN3bar20h4b0789288b21a387eaaE(), !dbg !20
store i64 %1, i64* %0, !dbg !20
%2 = load i64* %0, !dbg !20
store i64 %2, i64* %let
ret void, !dbg !22
}
...
!19 = !MDLocation(line: 4, scope: !4)
!20 = !MDLocation(line: 7, scope: !21)This one contains the function but the return statement is described as being on line 4 instead of line 3. That's definitely wrong. ; Function Attrs: alwaysinline uwtable
define internal i64 @_ZN3bar20he4086b460583a695eaaE() unnamed_addr #0 {
entry-block:
br label %return, !dbg !19
return: ; preds = %entry-block
ret i64 5, !dbg !21
}
...
!19 = !MDLocation(line: 3, scope: !20)
!21 = !MDLocation(line: 4, scope: !4)The outcome is still wrong though. |
brson
added
I-wrong
T-compiler
I-nominated
and removed
T-compiler
labels
Sep 22, 2016
This comment has been minimized.
This comment has been minimized.
|
Nominating to prioritize. |
michaelwoerister
self-assigned this
Sep 22, 2016
This comment has been minimized.
This comment has been minimized.
|
triage: P-medium |
rust-highfive
added
P-medium
and removed
I-nominated
labels
Sep 22, 2016
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister FYI this still seems to reproduce today, I think. |
This comment has been minimized.
This comment has been minimized.
|
Appears to still reproduce today.
|
jdm commentedApr 10, 2014