From 0783ab9a7f92318830d94d41857c36726cf84eaa Mon Sep 17 00:00:00 2001 From: Siva Chandra Date: Tue, 24 Mar 2015 18:32:27 +0000 Subject: [DWARF] If linkages names are missing, use decl context to get qualified names. Summary: This commit adds this alternate route only when parsing variable dies corresponding to global or static variables. The motivation for this is that GCC does not emit linkage names for functions and variables declared/defined in anonymous namespaces. Having this alternate route fixes one part of TestNamespace which fails when the test case is compiled with GCC. An alternate route to get fully qualified names of functions whose linkage names are missing will be added with a followup change. With that, the other failing part of TestNamespace will also be fixed. Test Plan: dotest.py -C gcc -p TestNamespace Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8569 llvm-svn: 233098 --- lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp') diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index 8935f7143e4..ef1b037000c 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -51,6 +51,7 @@ DWARFCompileUnit::DWARFCompileUnit(SymbolFileDWARF* dwarf2Data) : m_producer_version_major (0), m_producer_version_minor (0), m_producer_version_update (0), + m_language_type (eLanguageTypeUnknown), m_is_dwarf64 (false) { } @@ -68,6 +69,7 @@ DWARFCompileUnit::Clear() m_func_aranges_ap.reset(); m_user_data = NULL; m_producer = eProducerInvalid; + m_language_type = eLanguageTypeUnknown; m_is_dwarf64 = false; } @@ -1042,6 +1044,19 @@ DWARFCompileUnit::GetProducerVersionUpdate() return m_producer_version_update; } +LanguageType +DWARFCompileUnit::GetLanguageType() +{ + if (m_language_type != eLanguageTypeUnknown) + return m_language_type; + + const DWARFDebugInfoEntry *die = GetCompileUnitDIEOnly(); + if (die) + m_language_type = static_cast( + die->GetAttributeValueAsUnsigned(m_dwarf2Data, this, DW_AT_language, eLanguageTypeUnknown)); + return m_language_type; +} + bool DWARFCompileUnit::IsDWARF64() const { -- cgit v1.2.3