[Lldb-commits] [lldb] r181498 - Add all Decls found through FindExternalLexicalDecls

Thirumurthi, Ashok ashok.thirumurthi at intel.com
Thu May 9 07:45:10 PDT 2013

Hi Sean,

This commit introduced a regression that prevents the gcc test suite from running to completion (see http://lab.llvm.org:8011/builders/lldb-x86_64-linux/builds/3996).  Could you provide a little background on how specifically this change relates to the external AST layout provided by lldb?  I suspect that there is some sensitivity in parsing the DWARF that depends on the order in which child and parent decls are included in the DWARF, and I'm hoping that this failure is a good clue as to what's going wrong...

UNSUPPORTED: LLDB (gcc-x86_64) :: test_expr_grandchild_with_dsym (TestAnonymous.AnonymousTestCase) (dsym tests) 
python: RecordLayoutBuilder.cpp:2271: uint64_t {anonymous}::RecordLayoutBuilder::updateExternalFieldOffset(const clang::FieldDecl*, uint64_t): Assertion `ExternalFieldOffsets.find(Field) != ExternalFieldOffsets.end() && "Field does not have an external offset"' failed.

FYI, I can reproduce the same failure with icc 13.1.

- Ashok

-----Original Message-----
From: lldb-commits-bounces at cs.uiuc.edu [mailto:lldb-commits-bounces at cs.uiuc.edu] On Behalf Of Sean Callanan
Sent: Wednesday, May 08, 2013 9:10 PM
To: lldb-commits at cs.uiuc.edu
Subject: [Lldb-commits] [lldb] r181498 - Add all Decls found through FindExternalLexicalDecls

Author: spyffe
Date: Wed May  8 20:09:49 2013
New Revision: 181498

URL: http://llvm.org/viewvc/llvm-project?rev=181498&view=rev
Add all Decls found through FindExternalLexicalDecls to the DeclContext.  This fulfils the contract that we make with Clang by returning ELR_AlreadyLoaded.

This is a little aggressive in that it does not allow the ASTImporter to import the child decls with any lexical parent other than the Decl that reported them as children.



Modified: lldb/trunk/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangASTSource.cpp?rev=181498&r1=181497&r2=181498&view=diff
--- lldb/trunk/source/Expression/ClangASTSource.cpp (original)
+++ lldb/trunk/source/Expression/ClangASTSource.cpp Wed May  8 20:09:49 
+++ 2013
@@ -472,6 +472,18 @@ ClangASTSource::FindExternalLexicalDecls
+            DeclContext *decl_context_non_const = 
+ const_cast<DeclContext *>(decl_context);
+            if (copied_decl->getDeclContext() != decl_context)
+            {
+                if (copied_decl->getDeclContext()->containsDecl(copied_decl))
+                    copied_decl->getDeclContext()->removeDecl(copied_decl);
+                copied_decl->setDeclContext(decl_context_non_const);
+            }
+            if (!decl_context_non_const->containsDecl(copied_decl))
+                decl_context_non_const->addDeclInternal(copied_decl);

lldb-commits mailing list
lldb-commits at cs.uiuc.edu

More information about the lldb-commits mailing list