Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
khuey committed Jan 15, 2023
1 parent 847dc6e commit a393267
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/cargo/core/compiler/build_context/target_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,22 @@ impl TargetInfo {
should_replace_hyphens: true,
})
} else {
// Because DWARF Package (dwp) files are produced after the
// fact by another tool, there is nothing in the binary that
// provides a means to locate them. By convention, debuggers
// take the binary filename and append ".dwp" (including to
// binaries that already have an extension such as shared libs)
// to find the dwp.
ret.push(FileType {
suffix: format!("{}.dwp", suffix),
// It is important to preserve the existing suffix for
// e.g. shared libraries, where the dwp for libfoo.so is
// expected to be at libfoo.so.dwp.
suffix: format!("{suffix}.dwp"),
prefix: prefix.clone(),
flavor: FileFlavor::DebugInfo,
crate_type: Some(crate_type.clone()),
// Likewise, the dwp needs to match the primary artifact's
// hyphenation exactly.
should_replace_hyphens: crate_type != CrateType::Bin,
})
}
Expand Down

0 comments on commit a393267

Please sign in to comment.