link.exe: don't embed full path to PDB file in binary.
This commit is contained in:
parent
9ce37dc729
commit
3c49fe0cbd
3 changed files with 32 additions and 0 deletions
20
tests/run-make/pdb-alt-path/Makefile
Normal file
20
tests/run-make/pdb-alt-path/Makefile
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
include ../tools.mk
|
||||
|
||||
# only-windows-msvc
|
||||
|
||||
all:
|
||||
# Test that we don't have the full path to the PDB file in the binary
|
||||
$(RUSTC) main.rs -g --crate-name my_crate_name --crate-type bin
|
||||
$(CGREP) "my_crate_name.pdb" < $(TMPDIR)/my_crate_name.exe
|
||||
$(CGREP) -v "\\my_crate_name.pdb" < $(TMPDIR)/my_crate_name.exe
|
||||
|
||||
# Test that backtraces still can find debuginfo by checking that they contain symbol names and
|
||||
# source locations.
|
||||
RUST_BACKTRACE="full" $(TMPDIR)/my_crate_name.exe &> $(TMPDIR)/backtrace.txt || exit 0
|
||||
$(CGREP) "my_crate_name::main" < $(TMPDIR)/backtrace.txt
|
||||
$(CGREP) "pdb-alt-path\\main.rs:2" < $(TMPDIR)/backtrace.txt
|
||||
|
||||
# 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
|
||||
$(CGREP) "abcdefg.pdb" < $(TMPDIR)/my_crate_name.exe
|
||||
$(CGREP) -v "my_crate_name.pdb" < $(TMPDIR)/my_crate_name.exe
|
||||
3
tests/run-make/pdb-alt-path/main.rs
Normal file
3
tests/run-make/pdb-alt-path/main.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
panic!("backtrace please");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue