File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed
tests/run-make/pdb-alt-path Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 1010
1111 # Test that backtraces still can find debuginfo by checking that they contain symbol names and
1212 # source locations.
13- RUST_BACKTRACE="full" $(TMPDIR)/my_crate_name.exe &> $(TMPDIR)/backtrace.txt || exit 0
14- $(CGREP) "my_crate_name::main " < $(TMPDIR)/backtrace.txt
15- $(CGREP) "pdb-alt-path\\ main.rs:2 " < $(TMPDIR)/backtrace.txt
13+ $(TMPDIR)/my_crate_name.exe &> $(TMPDIR)/backtrace.txt
14+ $(CGREP) "my_crate_name::fn_in_backtrace " < $(TMPDIR)/backtrace.txt
15+ $(CGREP) "main.rs:15 " < $(TMPDIR)/backtrace.txt
1616
1717 # Test that explicitly passed `-Clink-arg=/PDBALTPATH:...` is respected
1818 $(RUSTC) main.rs -g --crate-name my_crate_name --crate-type bin -Clink-arg=/PDBALTPATH:abcdefg.pdb -Cforce-frame-pointers
Original file line number Diff line number Diff line change 1+ // The various #[inline(never)] annotations and std::hint::black_box calls are
2+ // an attempt to make unwinding as non-flaky as possible on i686-pc-windows-msvc.
3+
4+ #[ inline( never) ]
5+ fn generate_backtrace ( x : & u32 ) {
6+ std:: hint:: black_box ( x) ;
7+ let bt = std:: backtrace:: Backtrace :: force_capture ( ) ;
8+ println ! ( "{}" , bt) ;
9+ std:: hint:: black_box ( x) ;
10+ }
11+
12+ #[ inline( never) ]
13+ fn fn_in_backtrace ( x : & u32 ) {
14+ std:: hint:: black_box ( x) ;
15+ generate_backtrace ( x) ;
16+ std:: hint:: black_box ( x) ;
17+ }
18+
119fn main ( ) {
2- panic ! ( "backtrace please" ) ;
20+ let x = & 41 ;
21+ std:: hint:: black_box ( x) ;
22+ fn_in_backtrace ( x) ;
23+ std:: hint:: black_box ( x) ;
324}
You can’t perform that action at this time.
0 commit comments