[Lldb-commits] [PATCH] D35740: Fix PR33875 by distinguishing between DWO and clang modules

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 21 15:33:24 PDT 2017


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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35740.107728.patch
Type: text/x-patch
Size: 784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20170721/cbb6aa2f/attachment.bin>


More information about the lldb-commits mailing list