Get raw name from DIE, or referenced dependencies
(
dwarf: &Dwarf<R>,
unit: &Unit<R>,
entry: &DebuggingInformationEntry<R>,
debug_info_builder_context: &DebugInfoBuilderContext<R>,
)
| 218 | |
| 219 | // Get raw name from DIE, or referenced dependencies |
| 220 | pub(crate) fn get_raw_name<R: ReaderType>( |
| 221 | dwarf: &Dwarf<R>, |
| 222 | unit: &Unit<R>, |
| 223 | entry: &DebuggingInformationEntry<R>, |
| 224 | debug_info_builder_context: &DebugInfoBuilderContext<R>, |
| 225 | ) -> Option<String> { |
| 226 | match resolve_specification(dwarf, unit, entry, debug_info_builder_context) { |
| 227 | DieReference::UnitAndOffset((dwarf, entry_unit, entry_offset)) => { |
| 228 | if let Ok(Some(attr_val)) = entry_unit |
| 229 | .entry(entry_offset) |
| 230 | .unwrap() |
| 231 | .attr_value(constants::DW_AT_linkage_name) |
| 232 | { |
| 233 | if let Ok(attr_string) = dwarf.attr_string(entry_unit, attr_val.clone()) { |
| 234 | if let Ok(attr_string) = attr_string.to_string() { |
| 235 | return Some(attr_string.to_string()); |
| 236 | } |
| 237 | } else if let Some(dwarf) = &dwarf.sup { |
| 238 | if let Ok(attr_string) = dwarf.attr_string(entry_unit, attr_val) { |
| 239 | if let Ok(attr_string) = attr_string.to_string() { |
| 240 | return Some(attr_string.to_string()); |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | None |
| 246 | } |
| 247 | DieReference::Err => None, |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | // Get the size of an object as a usize |
| 252 | pub(crate) fn get_size_as_usize<R: ReaderType>( |
no test coverage detected