[Lldb-commits] [lldb] r308905 - RFix PR33875 by distinguishing between DWO and clang modules.

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 24 11:06:39 PDT 2017


Author: adrian
Date: Mon Jul 24 11:06:39 2017
New Revision: 308905

URL: http://llvm.org/viewvc/llvm-project?rev=308905&view=rev
Log:
RFix PR33875 by distinguishing between DWO and clang modules.

This reapplies https://reviews.llvm.org/D35740 with a tweak to find
the section by name rather than type. Section types don't distinguish
between regular sections and their DWO counterparts.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py?rev=308905&r1=308904&r2=308905&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py Mon Jul 24 11:06:39 2017
@@ -9,8 +9,6 @@ class TestWithGmodulesDebugInfo(TestBase
 
     mydir = TestBase.compute_mydir(__file__)
 
-    @expectedFailureAll(bugnumber="llvm.org/pr33875", oslist=["linux"],
-            compiler="clang", compiler_version=[">", "6.0"])
     @add_test_categories(["gmodules"])
     def test_specialized_typedef_from_pch(self):
         self.build()

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=308905&r1=308904&r2=308905&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp Mon Jul 24 11:06:39 2017
@@ -61,6 +61,14 @@ 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.
+  if (auto *section_list = m_obj_file->GetSectionList(false))
+    if (section_list->FindSectionByName(ConstString(".debug_info")))
+      return nullptr;
+
   // Only dwo files with 1 compile unit is supported
   if (GetNumCompileUnits() == 1)
     return DebugInfo()->GetCompileUnitAtIndex(0);




More information about the lldb-commits mailing list