[Lldb-commits] [lldb] r308911 - Don't allow .debug_types to be parsed as LLDB can crash when enums are not able to be found.

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 24 11:40:33 PDT 2017


Author: gclayton
Date: Mon Jul 24 11:40:33 2017
New Revision: 308911

URL: http://llvm.org/viewvc/llvm-project?rev=308911&view=rev
Log:
Don't allow .debug_types to be parsed as LLDB can crash when enums are not able to be found.

Differential Revision: https://reviews.llvm.org/D35734


Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=308911&r1=308910&r2=308911&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Jul 24 11:40:33 2017
@@ -497,6 +497,21 @@ uint32_t SymbolFileDWARF::CalculateAbili
     if (section_list == NULL)
       return 0;
 
+    // On non Apple platforms we might have .debug_types debug info that
+    // is created by using "-fdebug-types-section". LLDB currently will try
+    // to load this debug info, but it causes crashes during debugging when
+    // types are missing since it doesn't know how to parse the info in
+    // the .debug_types type units. This causes all complex debug info
+    // types to be unresolved. Because this causes LLDB to crash and since
+    // it really doesn't provide a solid debuggiung experience, we should
+    // disable trying to debug this kind of DWARF until support gets
+    // added or deprecated.
+    if (section_list->FindSectionByName(ConstString(".debug_types"))) {
+      m_obj_file->GetModule()->ReportWarning(
+        "lldb doesn’t support .debug_types debug info");
+      return 0;
+    }
+
     uint64_t debug_abbrev_file_size = 0;
     uint64_t debug_info_file_size = 0;
     uint64_t debug_line_file_size = 0;




More information about the lldb-commits mailing list