-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #99556 - davidtwco:collapse-debuginfo, r=wesleywiser
ssa: implement `#[collapse_debuginfo]` cc #39153 rust-lang/compiler-team#386 Debuginfo line information for macro invocations are collapsed by default - line information are replaced by the line of the outermost expansion site. Using `-Zdebug-macros` disables this behaviour. When the `collapse_debuginfo` feature is enabled, the default behaviour is reversed so that debuginfo is not collapsed by default. In addition, the `#[collapse_debuginfo]` attribute is available and can be applied to macro definitions which will then have their line information collapsed. r? rust-lang/wg-debugging
- Loading branch information
Showing
21 changed files
with
700 additions
and
36 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
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
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,61 @@ | ||
// ignore-lldb | ||
#![feature(collapse_debuginfo)] | ||
|
||
// Test that line numbers are not replaced with those of the outermost expansion site when the | ||
// `collapse_debuginfo` is active, `-Zdebug-macros` is provided and `#[collapse_debuginfo]` not | ||
// being used. | ||
|
||
// compile-flags:-g -Zdebug-macros | ||
|
||
// === GDB TESTS =================================================================================== | ||
|
||
// gdb-command:run | ||
// gdb-command:next | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc1[...] | ||
// gdb-command:next | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc2[...] | ||
// gdb-command:next | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc3[...] | ||
// gdb-command:next | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc4[...] | ||
// gdb-command:continue | ||
|
||
fn one() { | ||
println!("one"); | ||
} | ||
fn two() { | ||
println!("two"); | ||
} | ||
fn three() { | ||
println!("three"); | ||
} | ||
fn four() { | ||
println!("four"); | ||
} | ||
|
||
macro_rules! outer { | ||
($b:block) => { | ||
one(); // #loc1 | ||
inner!(); | ||
$b | ||
}; | ||
} | ||
|
||
macro_rules! inner { | ||
() => { | ||
two(); // #loc2 | ||
}; | ||
} | ||
|
||
fn main() { | ||
let ret = 0; // #break | ||
outer!({ | ||
three(); // #loc3 | ||
four(); // #loc4 | ||
}); | ||
std::process::exit(ret); | ||
} |
Oops, something went wrong.