about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorAndy Wang <cbeuw.andy@gmail.com>2021-12-05 20:49:23 +0000
committerAndy Wang <cbeuw.andy@gmail.com>2021-12-05 20:49:23 +0000
commite5796c46de20856f2eee0d8651572343d4fea9db (patch)
tree4ebf751e5541b0d3c225b5b17140bf5bc6a23078 /compiler/rustc_codegen_llvm
parentefec545293b9263be9edfb283a7aa66350b3acbf (diff)
downloadrust-e5796c46de20856f2eee0d8651572343d4fea9db.tar.gz
rust-e5796c46de20856f2eee0d8651572343d4fea9db.zip
Apply path remapping to DW_AT_GNU_dwo_name
Diffstat (limited to 'compiler/rustc_codegen_llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
index 10c7bb2eaea..f15f81a83b0 100644
--- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
+++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
@@ -1057,9 +1057,12 @@ pub fn compile_unit_metadata(
     let output_filenames = tcx.output_filenames(());
     let out_dir = &output_filenames.out_directory;
     let split_name = if tcx.sess.target_can_use_split_dwarf() {
-        output_filenames
-            .split_dwarf_path(tcx.sess.split_debuginfo(), Some(codegen_unit_name))
-            .map(|f| out_dir.join(f))
+        output_filenames.split_dwarf_path(tcx.sess.split_debuginfo(), Some(codegen_unit_name)).map(
+            |f| {
+                let joined = out_dir.join(f);
+                tcx.sess.source_map().path_mapping().map_prefix(joined).0
+            },
+        )
     } else {
         None
     }