Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] PDOM-Database Corrupt

Hi,
you should not be working on the PDOM directly, please use the IIndex
interfaces. Your starting point would be CCorePlugin.getIndexManager();
The interfaces are documented, if you are missing functionality, please
raise an enhancement request.

When you make queries into the index, you have to obtain a lock before
that. In case the indexer is running in parallel to your queries that
may 
cause your problems.

Markus.
   

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of lbuettik@xxxxxx
Sent: Freitag, 10. November 2006 13:26
To: cdt-dev@xxxxxxxxxxx
Subject: [cdt-dev] PDOM-Database Corrupt

Hi all,
I currently work on some refactoring stuff, therefor I try to find all
references to a field with the PDOM. But the following code snippet
won't work. It won't give any results and after that the PDOM-Database
is corrupt. You can't start Eclipse after that (hangs on 75% of the
startup procedure) until you delete the PDOM-Database (*.pdom files). I
use the cdt code from cvs version 3.1.1. I'm not sure if this is a
PDOM-Bug or if my code do something wrong or evil.
Thanks
leo

ITranslationUnit tu =
(ITranslationUnit)CCorePlugin.getDefault().getCoreModel().create(file);
PDOM pdom =
(PDOM)CCorePlugin.getPDOMManager().getPDOM(tu.getCProject()).getAdapter(
PDOM.class);
System.out.println(pdom);
IPDOMResolver resolver = (IPDOMResolver)pdom;
		
// new PDOMCPPLinkage(pdom);
PDOMCPPLinkageFactory linkageFactory = new PDOMCPPLinkageFactory();
PDOMLinkage linkage = linkageFactory.createLinkage(pdom);
PDOMBinding pdomNameBinding = linkage.adaptBinding(nameBinding);
		
IASTName[] pdomref = resolver.getReferences(pdomNameBinding);
System.out.println("---REFERENCES from PDOM---");
for (IASTName refName : pdomref) {
	namePrinterHelper(refName);
}
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top