gpt4 book ai didi

c++ - Eclipse (Juno) CDT 索引器 : "Error while parsing..." a Makefile project

转载 作者:行者123 更新时间:2023-11-28 07:50:42 39 4
gpt4 key购买 nike

我正在研究这个 Github project 的克隆在 Eclipse CDT 中,我还没有设法创建它的无错误索引(下面为 AncSplit.cpp 提供了错误日志示例)。所有的CPU资源(Intel® Core™ i7 CPU X 940 @ 2.13GHz × 8 with 8Gb RAM)被占用了一段时间,每个.cpp.h都会产生解析错误 项目中的文件。

为了重现/识别问题,我只将源文件和自定义项目 Makefile 保存在一个文件夹中。我还删除了 Eclipse(和工作区首选项...)并重新安装了它 from scratch .
N.B. 我还在 -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)

最佳答案

想通了,确实是个bug(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) 上检查了这个解决方法并且索引/解析现在可以正常工作。

关于c++ - Eclipse (Juno) CDT 索引器 : "Error while parsing..." a Makefile project,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13851002/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com