Community
Participate
Working Groups
Build ID: I20080617-2000 version 3.4.0 Steps To Reproduce: when we are using the eclipse with vmarg -ea if the soruce file [ ie cpp file ] has a method signature or static member declaration then getASTTranslationUnit fails to return the AST. It fails during the parsing. The same works fine when eclipse is lauched without this vmarg. please find the details where it fails. package org.eclipse.cdt.core.dom.parser; Class AbstractCLikeLanguage---- GPPLanguage final ISourceCodeParser parser= createParser(scanner, log, index, false, options); fails when you try to get the AST through the parse call IASTTranslationUnit ast= parser.parse(); More information:
I assume that an assertion fails, which should cause an entry in the error log. Please provide the relevant entry (<workspace>/.metadata/.log)
This occurs with org.eclipse.cdt.core_5.0.1.200809120802 The line of code says: assert fLocked; which I interpret as the assumption that the database is locked presumably to prevent concurrent access. A failure here may signal data corruption. -------------------------------- Database.getChunk(int) line: 242 BTree.accept(int, IBTreeVisitor) line: 551 BTree.accept(IBTreeVisitor) line: 535 PDOMFile.findFile(PDOM, BTree, IIndexFileLocation, int, IIndexLocationConverter) line: 507 WritablePDOM(PDOM).getFile(int, IIndexFileLocation) line: 300 WritablePDOM(PDOM).getFile(int, IIndexFileLocation) line: 1 CIndex.getFile(int, IIndexFileLocation) line: 208 IndexBasedCodeReaderFactory.getContentForInclusion(String) line: 132 CPreprocessor$1.checkFile(String, String) line: 96 CPreprocessor$1.checkFile(String, String) line: 1 CPreprocessor.findInclusion(String, boolean, boolean, File, IIncludeFileTester<T>) line: 783 CPreprocessor.findInclusion(String, boolean, boolean, File) line: 769 CPreprocessor.executeInclude(Lexer, int, boolean, boolean) line: 1059 CPreprocessor.executeDirective(Lexer, int) line: 899 CPreprocessor.internalFetchToken(boolean, boolean, boolean, boolean, ScannerContext) line: 603 CPreprocessor.fetchToken() line: 431 CPreprocessor.nextToken() line: 489 GNUCPPSourceParser(AbstractGNUSourceCodeParser).fetchToken() line: 331 GNUCPPSourceParser(AbstractGNUSourceCodeParser).LA(int) line: 196 GNUCPPSourceParser(AbstractGNUSourceCodeParser).LAcatchEOF(int) line: 211 GNUCPPSourceParser(AbstractGNUSourceCodeParser).parseTranslationUnit() line: 898 GNUCPPSourceParser(AbstractGNUSourceCodeParser).translationUnit() line: 890 GNUCPPSourceParser(AbstractGNUSourceCodeParser).parse() line: 476 GPPLanguage(AbstractCLikeLanguage).getASTTranslationUnit(CodeReader, IScannerInfo, ICodeReaderFactory, IIndex, int, IParserLogService) line: 139 TranslationUnit.getAST(IIndex, int, IProgressMonitor) line: 831 TranslationUnit.getAST(IIndex, int) line: 796 ...
You need to obtain a lock on the index, see documentation of IIndex.acquireReadLock()
That was easy. Thanks, Markus.