[Lldb-commits] [lldb] r309019 - Improve the fix for PR33875 by not hardcoding the section name.
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 25 13:12:25 PDT 2017
Author: adrian
Date: Tue Jul 25 13:12:25 2017
New Revision: 309019
URL: http://llvm.org/viewvc/llvm-project?rev=309019&view=rev
Log:
Improve the fix for PR33875 by not hardcoding the section name.
This is a follow-up to r308905.
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp?rev=309019&r1=309018&r2=309019&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp Tue Jul 25 13:12:25 2017
@@ -61,13 +61,13 @@ SymbolFileDWARFDwo::ParseCompileUnit(DWA
}
DWARFCompileUnit *SymbolFileDWARFDwo::GetCompileUnit() {
- // Clang modules are found via a skeleton CU, but are not DWO
- // objects. Clang modules have a .debug_info section instead of the
- // *_dwo variant. Note that this is hardcoding the ELF section name
- // based on the assumption that Mach-O does not use DWO objects.
+ // A clang module is found via a skeleton CU, but is not a proper DWO.
+ // Clang modules have a .debug_info section instead of the *_dwo variant.
if (auto *section_list = m_obj_file->GetSectionList(false))
- if (section_list->FindSectionByName(ConstString(".debug_info")))
- return nullptr;
+ if (auto section_sp =
+ section_list->FindSectionByType(eSectionTypeDWARFDebugInfo, true))
+ if (!section_sp->GetName().GetStringRef().endswith("dwo"))
+ return nullptr;
// Only dwo files with 1 compile unit is supported
if (GetNumCompileUnits() == 1)
More information about the lldb-commits
mailing list