summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2017-07-25 20:12:25 +0000
committerAdrian Prantl <aprantl@apple.com>2017-07-25 20:12:25 +0000
commit4b2113036d7573c2686ac572f3316e661ee52d7c (patch)
tree44a21c147c2b0dde7764008dbfeb34d5755632c0 /lldb
parentbdec541baaa58f637248f3f1a391b3a0ab87cb14 (diff)
downloadbcm5719-llvm-4b2113036d7573c2686ac572f3316e661ee52d7c.tar.gz
bcm5719-llvm-4b2113036d7573c2686ac572f3316e661ee52d7c.zip
Improve the fix for PR33875 by not hardcoding the section name.
This is a follow-up to r308905. llvm-svn: 309019
Diffstat (limited to 'lldb')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
index de4cfc2c738..99fd3340a3e 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -61,13 +61,13 @@ SymbolFileDWARFDwo::ParseCompileUnit(DWARFCompileUnit *dwarf_cu,
}
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)
OpenPOWER on IntegriCloud