-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved support of collapse_debuginfo attribute for macroses. Enable…
…d by default for builtin and core/std macroses.
- Loading branch information
Showing
12 changed files
with
389 additions
and
37 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
59 changes: 59 additions & 0 deletions
59
tests/debuginfo/collapse-debuginfo-in-non-collapse-macro.rs
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,59 @@ | ||
// ignore-lldb | ||
#![feature(collapse_debuginfo)] | ||
|
||
// Test that statement, skipped by macros, is correctly processed in debuginfo | ||
|
||
// compile-flags:-g | ||
|
||
// === GDB TESTS =================================================================================== | ||
|
||
// gdb-command:run | ||
// gdb-command:next | ||
// gdb-check:[...]#loc2[...] | ||
// gdb-command:step | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc_call1_pre[...] | ||
// gdb-command:next | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc_in_proxy[...] | ||
// gdb-command:finish | ||
// gdb-check:[...]#loc4[...] | ||
// gdb-command:next | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc5[...] | ||
// gdb-command:continue | ||
|
||
|
||
macro_rules! proxy_println { | ||
($($arg:tt)*) => {{ | ||
println!($($arg)*); // #loc_in_proxy | ||
}}; | ||
} | ||
|
||
// Macro accepts 3 statements and removes the 2nd statement | ||
macro_rules! remove_second_statement { | ||
($s1:stmt; $s2:stmt; $s3:stmt;) => { $s1 $s3 } | ||
} | ||
|
||
fn call1() { | ||
let rv = 0; // #loc_call1_pre | ||
proxy_println!("one"); // #loc_call1 | ||
} | ||
|
||
fn call2() { | ||
proxy_println!("two"); // #loc_call2 | ||
} | ||
|
||
fn call3() { | ||
proxy_println!("three"); // #loc_call3 | ||
} | ||
|
||
fn main() { | ||
let ret = 0; // #break, step should go to call1 | ||
remove_second_statement! { // #loc1 | ||
call1(); // #loc2, breakpoint should set to call1, step should go call3 | ||
call2(); // #loc3, breakpoint should set to call3 | ||
call3(); // #loc4, breakpoint should set to call3, step should go closing brace | ||
} | ||
std::process::exit(ret); // #loc5 | ||
} |
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,54 @@ | ||
// ignore-lldb | ||
#![feature(collapse_debuginfo)] | ||
|
||
// Test that statement, skipped by macros, is correctly processed in debuginfo | ||
|
||
// compile-flags:-g | ||
|
||
// === GDB TESTS =================================================================================== | ||
|
||
// gdb-command:run | ||
// gdb-command:next | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc2[...] | ||
// gdb-command:step | ||
// gdb-command:frame | ||
// gdb-command:step | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc_call1_println[...] | ||
// gdb-command:finish | ||
// gdb-command:finish | ||
// gdb-check:[...]#loc4[...] | ||
// gdb-command:next | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc5[...] | ||
// gdb-command:continue | ||
|
||
// Macro accepts 3 statements and removes the 2nd statement | ||
macro_rules! remove_second_statement { | ||
($s1:stmt; $s2:stmt; $s3:stmt;) => { $s1 $s3 } | ||
} | ||
|
||
fn call1() { | ||
(||{ | ||
println!("one") // #loc_call1_println | ||
})(); // #loc_call1 | ||
} | ||
|
||
fn call2() { | ||
println!("two"); // #loc_call2 | ||
} | ||
|
||
fn call3() { | ||
println!("three"); // #loc_call3 | ||
} | ||
|
||
fn main() { | ||
let ret = 0; // #break, step should go to call1 | ||
remove_second_statement! { // #loc1 | ||
call1(); // #loc2, breakpoint should set to call1, step should go call3 | ||
call2(); // #loc3, breakpoint should set to call3 | ||
call3(); // #loc4, breakpoint should set to call3, step should go closing brace | ||
} | ||
std::process::exit(ret); // #loc5 | ||
} |
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,48 @@ | ||
// ignore-lldb | ||
//#![feature(collapse_debuginfo)] | ||
|
||
// Test that statement, skipped by macros, is correctly processed in debuginfo | ||
|
||
// compile-flags:-g | ||
|
||
// === GDB TESTS =================================================================================== | ||
|
||
// gdb-command:run | ||
// gdb-command:next | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc2[...] | ||
// gdb-command:next | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc4[...] | ||
// gdb-command:next | ||
// gdb-command:frame | ||
// gdb-check:[...]#loc5[...] | ||
// gdb-command:continue | ||
|
||
|
||
// Macro accepts 3 statements and removes the 2nd statement | ||
macro_rules! remove_second_statement { | ||
($s1:stmt; $s2:stmt; $s3:stmt;) => { $s1 $s3 } | ||
} | ||
|
||
fn call1() { | ||
println!("one"); // #loc_call1 | ||
} | ||
|
||
fn call2() { | ||
println!("two"); // #loc_call2 | ||
} | ||
|
||
fn call3() { | ||
println!("three"); // #loc_call3 | ||
} | ||
|
||
fn main() { | ||
let ret = 0; // #break, step should go to call1 | ||
remove_second_statement! { // #loc1 | ||
call1(); // #loc2, breakpoint should set to call1, step should go call3 | ||
call2(); // #loc3, breakpoint should set to call3 | ||
call3(); // #loc4, breakpoint should set to call3, step should go closing brace | ||
} | ||
std::process::exit(ret); // #loc5 | ||
} |
Oops, something went wrong.