DU-chain classes questions ...

Sandro Andrade sandro.andrade at gmail.com
Thu Apr 15 01:28:06 UTC 2010


Hi all ...

Could anyone please (maybe Nolden, Apol, or Milian) help me to clarify some
points about
the use of DU-chain classes ? I'm running some problems related to
thread-safety of DU-chain
objects, symbol table, and updating of top-contexts. So, here they are:

I can find out four classes for declarations: Declaration,
IndexedDeclaration, DUChainPointer<Declaration> (DeclarationPointer),
and DeclarationId and three classes for top contexts: TopDUContext,
IndexedTopDUContext, and ReferencedTopDUContext.

1) Apparently while Declaration holds the entire data, IndexedDeclaration
keeps just an index to actual
declaration data, right ?

2) Looking at contextbrowser plugin source code, it seems that I must always
use IndexedDeclaration
instead of Declaration for those data which are going to be used across
DU-Chain locks and probably defined as member attributes. Is this correct ?
If yes, I still need to check if IndexedDeclaration::data() return a
non-zero declaration, right ?

3) Would I get the same result by using DeclarationId ? I'm still confused
about when to use a specific declaration class (IndexedDeclaration,
DeclarationPointer, DeclarationId).

4) I've seen someplace that a declaration can only be used from other
contexts if it is in the symbol table. That's because
of IndexedDeclaration keeps just the index to declaration in symbol table ?
So, should I always check this if I want to
use a declaration acquired in other context ?

5) Apparently ContextBrowser plugin doesn't collect the uses of a
declaration in background. However, UI doesn't
block, I guess because of the assynchronous call to updateContextForUrl. Is
this right ?

6) If I select a new symbol while collecting uses, apparently the collect is
paused and resumed from the last point if first symbol is selected again.
The pause point can be restored from m_waitForUpdate and m_updateReady QSets
in UsesCollector, but the question is: are the remaining updateContextForUrl
calls cancelled when a new symbol is selected ? Or do they run to completion
?

TIA,
Sandro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100414/2e7b8a2d/attachment.html>


More information about the KDevelop-devel mailing list