From 7141554858d2d857aab0ac15474a5a631efe526c Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Sat, 8 Dec 2012 00:24:40 +0000 Subject: [PATCH] Make sure to check for DW_AT_linkage_name to get the mangled name in the DWARF along with the older DW_AT_MIPS_linkage_name attribute. llvm-svn: 169657 --- lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp | 1 + lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp | 6 ++++++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp | 1 + lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index 244b69d..9f594d4 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -657,6 +657,7 @@ DWARFCompileUnit::Index (const uint32_t cu_idx, // break; case DW_AT_MIPS_linkage_name: + case DW_AT_linkage_name: if (attributes.ExtractFormValueAtIndex(m_dwarf2Data, i, form_value)) mangled_cstr = form_value.AsCString(debug_str); break; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp index 71c6c71..5411ee5 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -798,6 +798,7 @@ DWARFDebugInfoEntry::GetDIENamesAndRanges break; case DW_AT_MIPS_linkage_name: + case DW_AT_linkage_name: if (mangled == NULL) mangled = form_value.AsCString(&dwarf2Data->get_debug_str_data()); break; @@ -1488,6 +1489,9 @@ DWARFDebugInfoEntry::GetMangledName if (GetAttributeValue(dwarf2Data, cu, DW_AT_MIPS_linkage_name, form_value)) name = form_value.AsCString(&dwarf2Data->get_debug_str_data()); + if (GetAttributeValue(dwarf2Data, cu, DW_AT_linkage_name, form_value)) + name = form_value.AsCString(&dwarf2Data->get_debug_str_data()); + if (substitute_name_allowed && name == NULL) { if (GetAttributeValue(dwarf2Data, cu, DW_AT_name, form_value)) @@ -1518,6 +1522,8 @@ DWARFDebugInfoEntry::GetPubname if (GetAttributeValue(dwarf2Data, cu, DW_AT_MIPS_linkage_name, form_value)) name = form_value.AsCString(&dwarf2Data->get_debug_str_data()); + else if (GetAttributeValue(dwarf2Data, cu, DW_AT_linkage_name, form_value)) + name = form_value.AsCString(&dwarf2Data->get_debug_str_data()); else if (GetAttributeValue(dwarf2Data, cu, DW_AT_name, form_value)) name = form_value.AsCString(&dwarf2Data->get_debug_str_data()); else if (GetAttributeValue(dwarf2Data, cu, DW_AT_specification, form_value)) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp index 4df4d24..11e8d4c 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp @@ -124,6 +124,7 @@ DWARFDebugPubnames::GeneratePubnames(SymbolFileDWARF* dwarf2Data) break; case DW_AT_MIPS_linkage_name: + case DW_AT_linkage_name: if (attributes.ExtractFormValueAtIndex(dwarf2Data, i, form_value)) mangled = form_value.AsCString(debug_str); break; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 453515f..e6e9a16 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -3274,6 +3274,8 @@ SymbolFileDWARF::FunctionDieMatchesPartialName (const DWARFDebugInfoEntry* die, DWARFFormValue form_value; die->GetAttributes(this, dwarf_cu, NULL, attributes); uint32_t idx = attributes.FindAttributeIndex(DW_AT_MIPS_linkage_name); + if (idx == UINT32_MAX) + idx = attributes.FindAttributeIndex(DW_AT_linkage_name); if (idx != UINT32_MAX) { if (attributes.ExtractFormValueAtIndex(this, idx, form_value)) @@ -6056,6 +6058,7 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu, type_name_const_str.SetCString(type_name_cstr); break; + case DW_AT_linkage_name: case DW_AT_MIPS_linkage_name: break; // mangled = form_value.AsCString(&get_debug_str_data()); break; case DW_AT_type: type_die_offset = form_value.Reference(dwarf_cu); break; case DW_AT_accessibility: accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break; @@ -6893,6 +6896,7 @@ SymbolFileDWARF::ParseVariableDIE case DW_AT_decl_line: decl.SetLine(form_value.Unsigned()); break; case DW_AT_decl_column: decl.SetColumn(form_value.Unsigned()); break; case DW_AT_name: name = form_value.AsCString(&get_debug_str_data()); break; + case DW_AT_linkage_name: case DW_AT_MIPS_linkage_name: mangled = form_value.AsCString(&get_debug_str_data()); break; case DW_AT_type: type_uid = form_value.Reference(dwarf_cu); break; case DW_AT_external: is_external = form_value.Unsigned() != 0; break; -- 2.7.4