clayborg created this revision.
Herald added a subscriber: aprantl.

LLDB currently crashes when given .debug_types debug information which is 
enabled with -fdebug-types when compiling. All complex types are also missing. 
Seeing as LLDB crashes at worse, or debugs, but provides no type resolution for 
complex types, we should disable allowing LLDB to debug this until we add 
support.


https://reviews.llvm.org/D35734

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


Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -497,6 +497,21 @@
     if (section_list == NULL)
       return 0;
 
+    // On non Apple platforms we might have .debug_types debug info that
+    // is created by using "-fdebug-types". 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;


Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===================================================================
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -497,6 +497,21 @@
     if (section_list == NULL)
       return 0;
 
+    // On non Apple platforms we might have .debug_types debug info that
+    // is created by using "-fdebug-types". 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;
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to