我正在Eclipse CDT中修复此Github project,我还没有设法为它创建一个无错误的索引(下面给出AncSplit.cpp
的错误日志示例)。所有CPU资源(英特尔®酷睿™i7 CPU X 940 @ 2.13GHz×8,带8Gb RAM)都会占用一段时间,并为项目中的每个.cpp
和.h
文件生成解析错误
为了重现/识别问题,我只将源文件和自定义项目Makefile保存在一个文件夹中。我还删除了Eclipse(和工作区首选项...)并重新安装了它from scratch
NB 我还在-Xms1G
文件中进行了以下更改-Xmx2G
,-XX:MaxPermSize=1G
和eclipse.ini
,以避免与堆空间相关的问题。<登记/>
我正在使用Eclipse:
版本:Juno Service Release 1
建造ID:20121004-1855
提前致谢。
!SESSION 2012-12-12 23:44:47.084 -----------------------------------------------
eclipse.buildId=M20120914-1800
java.version=1.7.0_10
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.cpp.product
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.cpp.product
!ENTRY org.eclipse.cdt.core 4 0 2012-12-13 00:07:02.918
!MESSAGE Error while parsing /lagrange/AncSplit.cpp.
!STACK 0
java.lang.NullPointerException
at org.eclipse.cdt.internal.core.dom.parser.Value.isDependentValue(Value.java:373)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.isDependentArgument(CPPTemplates.java:2323)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.hasDependentArgument(CPPTemplates.java:2313)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiate(CPPTemplates.java:181)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiate(CPPTemplates.java:166)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.resolveDeferredClassInstance(CPPTemplates.java:2468)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.resolveUnknown(CPPTemplates.java:2393)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateType(CPPTemplates.java:1173)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.resolveUnknown(CPPTemplates.java:2401)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateType(CPPTemplates.java:1173)
at org.eclipse.cdt.internal.core.dom.parser.cpp.AbstractCPPClassSpecializationScope.getBases(AbstractCPPClassSpecializationScope.java:158)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassSpecialization.getBases(CPPClassSpecialization.java:219)
at org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.getBases(ClassTypeHelper.java:243)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.BaseClassLookup.lookupInBaseClass(BaseClassLookup.java:192)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.BaseClassLookup.lookupInBaseClass(BaseClassLookup.java:235)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.BaseClassLookup.lookupInBaseClasses(BaseClassLookup.java:54)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.lookup(CPPSemantics.java:983)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.resolveUnknownName(CPPSemantics.java:3679)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.resolveUnknown(CPPTemplates.java:2425)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateType(CPPTemplates.java:1173)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateType(CPPTemplates.java:1223)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.TemplateArgumentDeduction.deduceFromFunctionArgs(TemplateArgumentDeduction.java:125)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.TemplateArgumentDeduction.deduceForFunctionCall(TemplateArgumentDeduction.java:88)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateForFunctionCall(CPPTemplates.java:1749)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateForFunctionCall(CPPTemplates.java:1728)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.resolveFunction(CPPSemantics.java:2363)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFunctionSet.resolveFunction(EvalFunctionSet.java:187)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFunctionCall.instantiate(EvalFunctionCall.java:202)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalUnary.instantiate(EvalUnary.java:281)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalBinary.instantiate(EvalBinary.java:343)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateValue(CPPTemplates.java:866)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.createSpecialization(CPPTemplates.java:786)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassSpecialization.specializeMember(CPPClassSpecialization.java:176)
at org.eclipse.cdt.internal.core.dom.parser.cpp.AbstractCPPClassSpecializationScope.getBindings(AbstractCPPClassSpecializationScope.java:116)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.getBindingsFromScope(CPPSemantics.java:1205)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.lookup(CPPSemantics.java:953)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalID.resolveName(EvalID.java:320)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalID.instantiate(EvalID.java:307)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalBinary.instantiate(EvalBinary.java:343)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalBinary.instantiate(EvalBinary.java:343)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateValue(CPPTemplates.java:866)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.createSpecialization(CPPTemplates.java:786)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassSpecialization.specializeMember(CPPClassSpecialization.java:176)
at org.eclipse.cdt.internal.core.dom.parser.cpp.AbstractCPPClassSpecializationScope.getBindings(AbstractCPPClassSpecializationScope.java:116)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.getBindingsFromScope(CPPSemantics.java:1205)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.lookup(CPPSemantics.java:953)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalID.resolveName(EvalID.java:320)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalID.instantiate(EvalID.java:307)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateValue(CPPTemplates.java:866)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateArgument(CPPTemplates.java:1079)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateArguments(CPPTemplates.java:1053)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.resolveDeferredClassInstance(CPPTemplates.java:2447)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.resolveUnknown(CPPTemplates.java:2393)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateType(CPPTemplates.java:1173)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.resolveUnknown(CPPTemplates.java:2401)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.instantiateType(CPPTemplates.java:1173)
at org.eclipse.cdt.internal.core.dom.parser.cpp.AbstractCPPClassSpecializationScope.getBases(AbstractCPPClassSpecializationScope.java:158)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassSpecialization.getBases(CPPClassSpecialization.java:219)
at org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.getBases(ClassTypeHelper.java:243)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.inheritanceClosure(SemanticUtil.java:153)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil.getConversionOperators(SemanticUtil.java:129)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.BuiltinOperators.getClassConversionTypes(BuiltinOperators.java:669)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.BuiltinOperators.arithmeticAssignement(BuiltinOperators.java:487)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.BuiltinOperators.create(BuiltinOperators.java:195)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.BuiltinOperators.create(BuiltinOperators.java:68)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.findOverloadedOperator(CPPSemantics.java:3383)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.findOverloadedBinaryOperator(CPPSemantics.java:2992)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalBinary.computeOverload(EvalBinary.java:242)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalBinary.getOverload(EvalBinary.java:224)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression.getOverload(CPPASTBinaryExpression.java:262)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression.getImplicitNames(CPPASTBinaryExpression.java:131)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression.accept(CPPASTBinaryExpression.java:164)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTExpressionStatement.accept(CPPASTExpressionStatement.java:73)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement.accept(CPPASTCompoundStatement.java:85)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIfStatement.accept(CPPASTIfStatement.java:145)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement.accept(CPPASTCompoundStatement.java:85)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTIfStatement.accept(CPPASTIfStatement.java:145)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement.accept(CPPASTCompoundStatement.java:85)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTFunctionDefinition.accept(CPPASTFunctionDefinition.java:201)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTemplateDeclaration.accept(CPPASTTemplateDeclaration.java:127)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNamespaceDefinition.accept(CPPASTNamespaceDefinition.java:139)
at org.eclipse.cdt.internal.core.dom.parser.ASTTranslationUnit.accept(ASTTranslationUnit.java:251)
at org.eclipse.cdt.internal.core.pdom.PDOMWriter.extractSymbols(PDOMWriter.java:444)
at org.eclipse.cdt.internal.core.pdom.PDOMWriter.addSymbols(PDOMWriter.java:225)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.writeToIndex(AbstractIndexerTask.java:1170)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parseFile(AbstractIndexerTask.java:1007)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.parseLinkage(AbstractIndexerTask.java:828)
at org.eclipse.cdt.internal.core.pdom.AbstractIndexerTask.runTask(AbstractIndexerTask.java:508)
at org.eclipse.cdt.internal.core.pdom.indexer.PDOMIndexerTask.run(PDOMIndexerTask.java:139)
at org.eclipse.cdt.internal.core.pdom.indexer.PDOMRebuildTask.run(PDOMRebuildTask.java:87)
at org.eclipse.cdt.internal.core.pdom.PDOMIndexerJob.run(PDOMIndexerJob.java:137)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
答案 0 :(得分:1)
想出来,它确实是一个错误(and I have filed one) 我的一位同事设法完美地为Github项目编制了索引,结果是:
Indexed 'src' (20 sources, 1,061 headers) in 43.46 sec: 86,471 declarations; 231,728 references; 0 unresolved inclusions; 12 syntax errors; 592 unresolved names (0.19%)
他使用默认的Eclipse Juno CDT软件包在Fedora发行版上。这意味着他正在使用:
Eclipse C / C ++开发工具
版本:8.1.0.201206111645
与标准Juno CDT下载不完全相同:
Eclipse C / C ++开发工具
版本:8.1.1.201209170703
我通过安装Classic Juno和CDT 8.1.0在我的Ubuntu系统(12.04 LTS)上检查了这个解决方法,现在索引/解析工作正常。