aprantl created this revision.

The DWO handling code can get confused by clang modules which also use skeleton 
CUs to point to the object file with the full debug info. This patch detects 
whether an object is a "real" DWO or a clang module and prevents LLDB from 
interpreting clang modules as DWO. This fixes the regression in 
TestWithModuleDebugging.

http://llvm.org/bugs/show_bug.cgi?id=33875


Repository:
  rL LLVM

https://reviews.llvm.org/D35740

Files:
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp


Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===================================================================
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -61,6 +61,12 @@
 }
 
 DWARFCompileUnit *SymbolFileDWARFDwo::GetCompileUnit() {
+  // 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->FindSectionByType(eSectionTypeDWARFDebugInfo, true))
+      return nullptr;
+
   // Only dwo files with 1 compile unit is supported
   if (GetNumCompileUnits() == 1)
     return DebugInfo()->GetCompileUnitAtIndex(0);


Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===================================================================
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -61,6 +61,12 @@
 }
 
 DWARFCompileUnit *SymbolFileDWARFDwo::GetCompileUnit() {
+  // 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->FindSectionByType(eSectionTypeDWARFDebugInfo, true))
+      return nullptr;
+
   // Only dwo files with 1 compile unit is supported
   if (GetNumCompileUnits() == 1)
     return DebugInfo()->GetCompileUnitAtIndex(0);
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to