@@ -221,21 +221,31 @@ pub(crate) fn get_raw_name<R: ReaderType>(
221221 dwarf : & Dwarf < R > ,
222222 unit : & Unit < R > ,
223223 entry : & DebuggingInformationEntry < R > ,
224+ debug_info_builder_context : & DebugInfoBuilderContext < R > ,
224225) -> Option < String > {
225- if let Ok ( Some ( attr_val) ) = entry. attr_value ( constants:: DW_AT_linkage_name ) {
226- if let Ok ( attr_string) = dwarf. attr_string ( unit, attr_val. clone ( ) ) {
227- if let Ok ( attr_string) = attr_string. to_string ( ) {
228- return Some ( attr_string. to_string ( ) ) ;
229- }
230- } else if let Some ( dwarf) = dwarf. sup ( ) {
231- if let Ok ( attr_string) = dwarf. attr_string ( unit, attr_val) {
232- if let Ok ( attr_string) = attr_string. to_string ( ) {
233- return Some ( attr_string. to_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+ }
234243 }
235244 }
245+ None
236246 }
247+ DieReference :: Err => None ,
237248 }
238- None
239249}
240250
241251// Get the size of an object as a usize
0 commit comments