This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +37
-21
lines changed
tests/run-make/pdb-alt-path Expand file tree Collapse file tree 3 files changed +37
-21
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,6 @@ run-make/pass-linker-flags-flavor/Makefile
131131run-make/pass-linker-flags-from-dep/Makefile
132132run-make/pass-linker-flags/Makefile
133133run-make/pass-non-c-like-enum-to-c/Makefile
134- run-make/pdb-alt-path/Makefile
135134run-make/pdb-buildinfo-cl-cmd/Makefile
136135run-make/pgo-gen-lto/Makefile
137136run-make/pgo-gen-no-imp-symbols/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // The information inside a .exe file contains a string of the PDB file name.
2+ // This could be a security concern if the full path was exposed, as it could
3+ // reveal information about the filesystem where the bin was first compiled.
4+ // This should only be overridden by `-Clink-arg=/PDBALTPATH:...` - this test
5+ // checks that no full file paths are exposed and that the override flag is respected.
6+ // See https://github.com/rust-lang/rust/pull/121297
7+
8+ //@ only-windows-msvc
9+
10+ fn main ( ) {
11+ // Test that we don't have the full path to the PDB file in the binary
12+ rustc ( )
13+ . input ( "main.rs" )
14+ . arg ( "-g" )
15+ . crate_name ( "my_crate_name" )
16+ . crate_type ( "bin" )
17+ . arg ( "-Cforce-frame-pointers" )
18+ . run ( ) ;
19+ invalid_utf8_contains ( bin_name ( "my_crate_name" ) , "my_crate_name.pdb" ) ;
20+ invalid_utf8_not_contains ( bin_name ( "my_crate_name" ) , r#"\my_crate_name.pdb"# ) ;
21+ // Test that backtraces still can find debuginfo by checking that they contain symbol names and
22+ // source locations.
23+ let out = run ( bin_name ( my_crate_name) ) ;
24+ out. assert_stdout_contains ( "my_crate_name::fn_in_backtrace" ) ;
25+ out. assert_stdout_contains ( "main.rs:15" ) ;
26+ // Test that explicitly passed `-Clink-arg=/PDBALTPATH:...` is respected
27+ rustc ( )
28+ . input ( "main.rs" )
29+ . arg ( "-g" )
30+ . crate_name ( "my_crate_name" )
31+ . crate_type ( "bin" )
32+ . link_arg ( "/PDBALTPATH:abcdefg.pdb" )
33+ . arg ( "-Cforce-frame-pointers" )
34+ . run ( ) ;
35+ invalid_utf8_contains ( bin_name ( "my_crate_name" ) , "abcdefg.pdb" ) ;
36+ invalid_utf8_not_contains ( bin_name ( "my_crate_name" ) , "my_crate_name.pdb" ) ;
37+ }
You can’t perform that action at this time.
0 commit comments