From 4cdc633301e3c760fb36470afc216a9e09351fa3 Mon Sep 17 00:00:00 2001 From: Florian Schmiderer Date: Mon, 3 Jul 2023 13:11:27 +0200 Subject: Add missing Debuginfo to PDB debug file on windows. Set Arg0 and CommandLineArgs in MCTargetoptions so LLVM outputs correct CL and CMD in LF_DEBUGINFO instead of empty/invalid values. --- compiler/rustc_session/src/session.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'compiler/rustc_session/src') diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 86db2edab7b..9bff9017881 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -204,6 +204,12 @@ pub struct Session { /// The version of the rustc process, possibly including a commit hash and description. pub cfg_version: &'static str, + + /// All commandline args used to invoke the compiler, with @file args fully expanded. + /// This will only be used within debug info, e.g. in the pdb file on windows + /// This is mainly useful for other tools that reads that debuginfo to figure out + /// how to call the compiler with the same arguments. + pub expanded_args: Vec, } pub struct PerfStats { @@ -1325,6 +1331,7 @@ pub fn build_session( target_override: Option, cfg_version: &'static str, ice_file: Option, + expanded_args: Vec, ) -> Session { // FIXME: This is not general enough to make the warning lint completely override // normal diagnostic warnings, since the warning lint can also be denied and changed @@ -1467,6 +1474,7 @@ pub fn build_session( target_features: Default::default(), unstable_target_features: Default::default(), cfg_version, + expanded_args, }; validate_commandline_args_with_session_available(&sess); -- cgit 1.4.1-3-g733a5