Skip to content

Commit e5796c4

Browse files
committed
Apply path remapping to DW_AT_GNU_dwo_name
1 parent efec545 commit e5796c4

File tree

2 files changed

+16
-4
lines changed
  • compiler/rustc_codegen_llvm/src/debuginfo
  • src/test/run-make-fulldeps/split-dwarf

2 files changed

+16
-4
lines changed

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1057,9 +1057,12 @@ pub fn compile_unit_metadata(
10571057
let output_filenames = tcx.output_filenames(());
10581058
let out_dir = &output_filenames.out_directory;
10591059
let split_name = if tcx.sess.target_can_use_split_dwarf() {
1060-
output_filenames
1061-
.split_dwarf_path(tcx.sess.split_debuginfo(), Some(codegen_unit_name))
1062-
.map(|f| out_dir.join(f))
1060+
output_filenames.split_dwarf_path(tcx.sess.split_debuginfo(), Some(codegen_unit_name)).map(
1061+
|f| {
1062+
let joined = out_dir.join(f);
1063+
tcx.sess.source_map().path_mapping().map_prefix(joined).0
1064+
},
1065+
)
10631066
} else {
10641067
None
10651068
}

src/test/run-make-fulldeps/split-dwarf/Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
# only-linux
44

5-
all:
5+
all: packed remapped
6+
7+
remapped:
8+
$(RUSTC) -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 --remap-path-prefix $$PWD= foo.rs -g
9+
objdump -Wi $(TMPDIR)/foo | grep $$PWD && exit 1 || exit 0
10+
11+
$(RUSTC) -Z unstable-options -C split-debuginfo=unpacked -C debuginfo=2 --remap-path-prefix $$PWD= foo.rs -g
12+
objdump -Wi $(TMPDIR)/foo | grep $$PWD && exit 1 || exit 0
13+
14+
packed:
615
$(RUSTC) -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 foo.rs -g
716
rm $(TMPDIR)/foo.dwp
817
rm $(TMPDIR)/$(call BIN,foo)

0 commit comments

Comments
 (0)