mirror of https://github.com/rust-lang/rust.git
Make pdb-alt-path test more unwind-friendly for i686-pc-windows-msvc
This commit is contained in:
parent
e1c3a5a7aa
commit
0a094bae28
|
@ -10,9 +10,9 @@ all:
|
||||||
|
|
||||||
# Test that backtraces still can find debuginfo by checking that they contain symbol names and
|
# Test that backtraces still can find debuginfo by checking that they contain symbol names and
|
||||||
# source locations.
|
# source locations.
|
||||||
RUST_BACKTRACE="full" $(TMPDIR)/my_crate_name.exe &> $(TMPDIR)/backtrace.txt || exit 0
|
$(TMPDIR)/my_crate_name.exe &> $(TMPDIR)/backtrace.txt
|
||||||
$(CGREP) "my_crate_name::main" < $(TMPDIR)/backtrace.txt
|
$(CGREP) "my_crate_name::fn_in_backtrace" < $(TMPDIR)/backtrace.txt
|
||||||
$(CGREP) "pdb-alt-path\\main.rs:2" < $(TMPDIR)/backtrace.txt
|
$(CGREP) "main.rs:15" < $(TMPDIR)/backtrace.txt
|
||||||
|
|
||||||
# Test that explicitly passed `-Clink-arg=/PDBALTPATH:...` is respected
|
# Test that explicitly passed `-Clink-arg=/PDBALTPATH:...` is respected
|
||||||
$(RUSTC) main.rs -g --crate-name my_crate_name --crate-type bin -Clink-arg=/PDBALTPATH:abcdefg.pdb -Cforce-frame-pointers
|
$(RUSTC) main.rs -g --crate-name my_crate_name --crate-type bin -Clink-arg=/PDBALTPATH:abcdefg.pdb -Cforce-frame-pointers
|
||||||
|
|
|
@ -1,3 +1,24 @@
|
||||||
fn main() {
|
// The various #[inline(never)] annotations and std::hint::black_box calls are
|
||||||
panic!("backtrace please");
|
// an attempt to make unwinding as non-flaky as possible on i686-pc-windows-msvc.
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
|
fn generate_backtrace(x: &u32) {
|
||||||
|
std::hint::black_box(x);
|
||||||
|
let bt = std::backtrace::Backtrace::force_capture();
|
||||||
|
println!("{}", bt);
|
||||||
|
std::hint::black_box(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(never)]
|
||||||
|
fn fn_in_backtrace(x: &u32) {
|
||||||
|
std::hint::black_box(x);
|
||||||
|
generate_backtrace(x);
|
||||||
|
std::hint::black_box(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let x = &41;
|
||||||
|
std::hint::black_box(x);
|
||||||
|
fn_in_backtrace(x);
|
||||||
|
std::hint::black_box(x);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue