Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] CDT development environment setup on new laptop: index database not locked

Ok sorry I just realized the -ea JVM argument was in the run configuration by default while it was not on my colleague’s machine :/ But at least we realized that we’re doing something wrong with the lock.

Sorry for the spam.
Marco

On Tue, Apr 28, 2015 at 3:41 PM Marco Syfrig <marco.syfrig@xxxxxxxxx> wrote:
Hi

I have to setup the whole environment to develop a CDT plug-in on a new laptop. I’ve done the whole process already on 4 different computers successfully so I thought it should be easy. I followed these step here https://wiki.eclipse.org/Getting_started_with_CDT_development.

I’ve installed a separate Eclipse, installed CDT 8.6 and set it as baseline, installed „API Tools Execution Environment Descriptions“ for 4.4 Then checked out branch 8.6 from  git://git.eclipse.org/gitroot/cdt/org.eclipse.cdt.git (because of the generic getAdapter from 4.5 M6 I would get errors with the current master branch because I’m still using 4.4 and the casts are missing). Then resolved and set cdt-e4.4.target as target platform.

I then get an error in the index (exactly in Database.getChunk(Database.java:271), see stacktrace at the end) when trying to call IASTName.resolveBinding(). Line 271 is „ assert fLocked;“ in my version, so fLocked is false.
This only happens when I try to resolve the binding from my plug-in code, Other calls to Database.getChunk from CDT itself work. I first get the index via
CCorePlugin.getIndexManager().getIndex(
        project, IIndexManager.ADD_DEPENDENCIES |  IndexManager.ADD_DEPENDENT | IndexManager.ADD_EXTENSION_FRAGMENTS_NAVIGATION);

And then get the IASTTranslationUnit via
index.acquireReadLock();
translationUnit.getAST(index,0);
// …
index.releaseReadLock();
The code has always worked until now, respectively is still on my colleague’s machine. He just built our plug-in for me and I installed it on my CDT installation (also 8.6) I use as baseline and I get no error there. So I don’t think it has something to do with my machine but rather I did something wrong with versions.

Anyone has an idea and can help me? I’ve tried it yesterday for hours (tried all versions back to 8.3) and today again and even copied all CDT projects from my colleague and his runtime workspace and got the same error while it is working on his machine. I’m slowly losing hope that I can develop again…

Btw: I’m compiling with 1.7 and using 1.7.0_55 to execute.

Thanks,
Marco

Caused by: java.lang.AssertionError
at org.eclipse.cdt.internal.core.pdom.db.Database.getChunk(Database.java:271)
at org.eclipse.cdt.internal.core.pdom.db.Database.getRecPtr(Database.java:486)
at org.eclipse.cdt.internal.core.pdom.db.BTree.accept(BTree.java:531)
at org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage.getBindingsViaCache(PDOMLinkage.java:408)
at org.eclipse.cdt.internal.core.pdom.PDOM.findBindings(PDOM.java:1330)
at org.eclipse.cdt.internal.core.pdom.PDOM.findBindings(PDOM.java:1320)
at org.eclipse.cdt.internal.core.index.CIndex.findBindings(CIndex.java:642)
at org.eclipse.cdt.internal.core.index.CIndex.findBindings(CIndex.java:503)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPScope.getBindings(CPPScope.java:198)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.getBindingsFromScope(CPPSemantics.java:1256)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.lookup(CPPSemantics.java:1004)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics.resolveBinding(CPPSemantics.java:290)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.createBinding(CPPVisitor.java:288)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName.createIntermediateBinding(CPPASTName.java:61)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNameBase.resolvePreBinding(CPPASTNameBase.java:94)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates.createBinding(CPPTemplates.java:714)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTTemplateId.createIntermediateBinding(CPPASTTemplateId.java:124)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNameBase.resolvePreBinding(CPPASTNameBase.java:94)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.getBaseType(CPPVisitor.java:2230)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.createType(CPPVisitor.java:2200)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.createType(CPPVisitor.java:2037)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.createBinding(CPPVisitor.java:861)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.createBinding(CPPVisitor.java:311)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTName.createIntermediateBinding(CPPASTName.java:61)
at org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTNameBase.resolveBinding(CPPASTNameBase.java:107)

Back to the top