Rollup merge of #106811 - khuey:dwp_extension, r=davidtwco

Append .dwp to the binary filename instead of replacing the existing extension.

gdb et al. expect to find the dwp file at `<binary>`.dwp, even if <binary> already has an extension (e.g. libfoo.so's dwp is expected to be at libfoo.so.dwp).
This commit is contained in:
Matthias Krüger 2023-01-26 07:53:23 +01:00 committed by GitHub
commit 59fcb7a2ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -599,7 +599,8 @@ fn link_dwarf_object<'a>(
cg_results: &CodegenResults,
executable_out_filename: &Path,
) {
let dwp_out_filename = executable_out_filename.with_extension("dwp");
let mut dwp_out_filename = executable_out_filename.to_path_buf().into_os_string();
dwp_out_filename.push(".dwp");
debug!(?dwp_out_filename, ?executable_out_filename);
#[derive(Default)]