-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Line-based breakpoints in inline functions don't show correct source #13442
Comments
Taking some notes here:
|
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
} |
Maybe |
Yeah, I need to find out where this inlining happens. Do we do it? Does LLVM do it? |
Try looking at the .0.noopt.bc file produced by -C save-temps instead
|
@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. |
Nominating to prioritize. |
triage: P-medium |
@michaelwoerister FYI this still seems to reproduce today, I think. |
Appears to still reproduce today.
|
it seems that still can't set breakpoint in inlined functions now |
I believe this issue was closed incorrectly. 7741e3d does not appear to have anything to do with it. |
Indeed! |
Add reasons for or remove some `//@no-rustfix` annotations changelog: none
The text was updated successfully, but these errors were encountered: