Merge pull request #3192 from alexcrichton/no-comp-dir
Don't require `DW_AT_comp_dir` for debuginfo
This commit is contained in:
@@ -63,17 +63,20 @@ where
|
|||||||
};
|
};
|
||||||
let comp_dir = root.attr_value(gimli::DW_AT_comp_dir)?;
|
let comp_dir = root.attr_value(gimli::DW_AT_comp_dir)?;
|
||||||
let comp_name = root.attr_value(gimli::DW_AT_name)?;
|
let comp_name = root.attr_value(gimli::DW_AT_name)?;
|
||||||
let out_comp_dir = clone_attr_string(
|
let out_comp_dir = match &comp_dir {
|
||||||
comp_dir.as_ref().context("comp_dir")?,
|
Some(comp_dir) => Some(clone_attr_string(
|
||||||
|
comp_dir,
|
||||||
gimli::DW_FORM_strp,
|
gimli::DW_FORM_strp,
|
||||||
unit,
|
unit,
|
||||||
debug_str,
|
debug_str,
|
||||||
debug_str_offsets,
|
debug_str_offsets,
|
||||||
debug_line_str,
|
debug_line_str,
|
||||||
out_strings,
|
out_strings,
|
||||||
)?;
|
)?),
|
||||||
|
None => None,
|
||||||
|
};
|
||||||
let out_comp_name = clone_attr_string(
|
let out_comp_name = clone_attr_string(
|
||||||
comp_name.as_ref().context("comp_name")?,
|
comp_name.as_ref().context("missing DW_AT_name attribute")?,
|
||||||
gimli::DW_FORM_strp,
|
gimli::DW_FORM_strp,
|
||||||
unit,
|
unit,
|
||||||
debug_str,
|
debug_str,
|
||||||
@@ -102,7 +105,7 @@ where
|
|||||||
let mut out_program = write::LineProgram::new(
|
let mut out_program = write::LineProgram::new(
|
||||||
out_encoding,
|
out_encoding,
|
||||||
line_encoding,
|
line_encoding,
|
||||||
out_comp_dir,
|
out_comp_dir.unwrap_or_else(|| write::LineString::String(Vec::new())),
|
||||||
out_comp_name,
|
out_comp_name,
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user