-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ssa: implement
#[collapse_debuginfo]
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. Signed-off-by: David Wood <[email protected]>
- Loading branch information
Showing
20 changed files
with
699 additions
and
35 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
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.