[Lldb-commits] [lldb] r260618 - Removed a bad assertion:

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 11 15:36:57 PST 2016


Author: gclayton
Date: Thu Feb 11 17:36:57 2016
New Revision: 260618

URL: http://llvm.org/viewvc/llvm-project?rev=260618&view=rev
Log:
Removed a bad assertion:

assert(((SymbolFileDWARF*)m_ast.GetSymbolFile())->UserIDMatches(die.GetDIERef().GetUID()) &&
       "Adding incorrect type to forward declaration map");

The problem is that "m_ast.GetSymbolFile()" can return a SymbolFileDWARFDebugMap. The code is doing the right thing if the assertion is ignored.

<rdar://problem/24437972>


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

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=260618&r1=260617&r2=260618&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Thu Feb 11 17:36:57 2016
@@ -886,8 +886,10 @@ DWARFASTParserClang::ParseTypeFromDWARF
                             // When the definition needs to be defined.
                             assert(!dwarf->GetForwardDeclClangTypeToDie().count(ClangASTContext::RemoveFastQualifiers(clang_type).GetOpaqueQualType()) &&
                                    "Type already in the forward declaration map!");
-                            assert(((SymbolFileDWARF*)m_ast.GetSymbolFile())->UserIDMatches(die.GetDIERef().GetUID()) &&
-                                   "Adding incorrect type to forward declaration map");
+                            // Can't assume m_ast.GetSymbolFile() is actually a SymbolFileDWARF, it can be a
+                            // SymbolFileDWARFDebugMap for Apple binaries.
+                            //assert(((SymbolFileDWARF*)m_ast.GetSymbolFile())->UserIDMatches(die.GetDIERef().GetUID()) &&
+                            //       "Adding incorrect type to forward declaration map");
                             dwarf->GetForwardDeclDieToClangType()[die.GetDIE()] = clang_type.GetOpaqueQualType();
                             dwarf->GetForwardDeclClangTypeToDie()[ClangASTContext::RemoveFastQualifiers(clang_type).GetOpaqueQualType()] = die.GetDIERef();
                             m_ast.SetHasExternalStorage (clang_type.GetOpaqueQualType(), true);




More information about the lldb-commits mailing list