[Lldb-commits] [lldb] r361948 - Revert "D11003: Tolerate DWARF compile unit without filename."

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed May 29 04:28:35 PDT 2019

Author: labath
Date: Wed May 29 04:28:35 2019
New Revision: 361948

URL: http://llvm.org/viewvc/llvm-project?rev=361948&view=rev
Revert "D11003: Tolerate DWARF compile unit without filename."

This code is modifying a support file list after it has been created.
This makes it hard to share the file list between type units and
compile units in DWARF. It's not a total showstopper, but supporting
this while also sharing the lists would make things more complicated.

Given that this was added to support a project which never fully
materialised, and that even back then there were some concerns about the
correctness of this approach (according to D11003#200772 the compile
unit name is not guaranteed to be the first one in the support file
list), I think we should just delete this workaround.

Reviewers: clayborg, tberghammer, dsrbecky

Subscribers: aprantl, lldb-commits

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


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=361948&r1=361947&r2=361948&view=diff
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed May 29 04:28:35 2019
@@ -689,19 +689,6 @@ lldb::CompUnitSP SymbolFileDWARF::ParseC
                 module_sp, dwarf_cu, cu_file_spec, dwarf_cu->GetID(),
                 cu_language, is_optimized ? eLazyBoolYes : eLazyBoolNo);
-            // If we just created a compile unit with an invalid file spec,
-            // try and get the first entry in the supports files from the
-            // line table as that should be the compile unit.
-            if (!cu_file_spec) {
-              cu_file_spec = cu_sp->GetSupportFiles().GetFileSpecAtIndex(1);
-              if (cu_file_spec) {
-                (FileSpec &)(*cu_sp) = cu_file_spec;
-                // Also fix the invalid file spec which was copied from the
-                // compile unit.
-                cu_sp->GetSupportFiles().Replace(0, cu_file_spec);
-              }
-            }

More information about the lldb-commits mailing list