From f381cd6d84ab17c1c3103e9b3b743ca2a8a49454 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Sat, 23 Mar 2024 16:17:15 +0000 Subject: [PATCH] Generate pdb file when strip=debuginfo --- compiler/rustc_codegen_ssa/src/back/linker.rs | 4 ++-- src/doc/rustc/src/codegen-options/index.md | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/linker.rs b/compiler/rustc_codegen_ssa/src/back/linker.rs index f5640ea26bc8c..b4abbf4f630cc 100644 --- a/compiler/rustc_codegen_ssa/src/back/linker.rs +++ b/compiler/rustc_codegen_ssa/src/back/linker.rs @@ -924,7 +924,7 @@ impl<'a> Linker for MsvcLinker<'a> { fn debuginfo(&mut self, strip: Strip, natvis_debugger_visualizers: &[PathBuf]) { match strip { - Strip::None => { + Strip::None | Strip::Debuginfo => { // This will cause the Microsoft linker to generate a PDB file // from the CodeView line tables in the object files. self.cmd.arg("/DEBUG"); @@ -965,7 +965,7 @@ impl<'a> Linker for MsvcLinker<'a> { self.cmd.arg(arg); } } - Strip::Debuginfo | Strip::Symbols => { + Strip::Symbols => { self.cmd.arg("/DEBUG:NONE"); } } diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md index 4a4f1ae98e407..b18c315bd0ac1 100644 --- a/src/doc/rustc/src/codegen-options/index.md +++ b/src/doc/rustc/src/codegen-options/index.md @@ -552,8 +552,7 @@ Supported values for this option are: binary or separate files depending on the target (e.g. `.pdb` files in case of MSVC). - `debuginfo` - debuginfo sections and debuginfo symbols from the symbol table - section are stripped at link time and are not copied to the produced binary - or separate files. + section are stripped at link time and are not copied to the produced binary. - `symbols` - same as `debuginfo`, but the rest of the symbol table section is stripped as well if the linker supports it.