forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#69357 - tmiasko:debuginfo-column, r=michael…
…woerister Emit 1-based column numbers in debuginfo * Use byte offsets instead of char position offsets. Resolves rust-lang#67360. * Use 1-based offsets instead of 0-based ones. Resolves rust-lang#65437. * Consistently omit column information for msvc targets, matching clang behaviour (previously columns have been omitted from `DILocation`, but not from `DILexicalBlock`).
- Loading branch information
Showing
7 changed files
with
97 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Verify that no column information is emitted for MSVC targets | ||
// | ||
// only-msvc | ||
// compile-flags: -C debuginfo=2 | ||
|
||
// CHECK-NOT: !DILexicalBlock({{.*}}column: {{.*}}) | ||
// CHECK-NOT: !DILocation({{.*}}column: {{.*}}) | ||
|
||
pub fn add(a: u32, b: u32) -> u32 { | ||
a + b | ||
} | ||
|
||
fn main() { | ||
let c = add(1, 2); | ||
println!("{}", c); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Verify that debuginfo column nubmers are 1-based byte offsets. | ||
// | ||
// ignore-windows | ||
// compile-flags: -C debuginfo=2 | ||
|
||
fn main() { | ||
unsafe { | ||
// Column numbers are 1-based. Regression test for #65437. | ||
// CHECK: call void @giraffe(), !dbg [[A:!.*]] | ||
giraffe(); | ||
|
||
// Column numbers use byte offests. Regression test for #67360 | ||
// CHECK: call void @turtle(), !dbg [[B:!.*]] | ||
/* ż */ turtle(); | ||
|
||
// CHECK: [[A]] = !DILocation(line: 10, column: 9, | ||
// CHECK: [[B]] = !DILocation(line: 14, column: 10, | ||
} | ||
} | ||
|
||
extern { | ||
fn giraffe(); | ||
fn turtle(); | ||
} |