Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Indexer get 0 results

Hi Nathan, Marc-Andre,all,

Thanks a lot for your suggestions, 
I am using CDT 9.2.1.

I have a custom wizard for project creation and using some api to create CDT properties for the project.
When project is created I have selected "use active build configuration" in cdt properties and indexer seems to get 0 results, indeed.
When I reimport the project, it changes into "Use a fixed build configuration", and indexer is better.

How to set from the beginning" Use a fixed build configuration  " ?
How to programmatically select "Store settings with project?"
I found to use 

IndexerPreferences.setScope(project, IndexerPreferences.SCOPE_PROJECT_SHARED); 

but it is API restricted, it make possible to check the option, but the file org.eclipse.cdt.core.prefs is not created.

Some samples of logs from cdt + my logs, I will try to provide more concrete details later:
I restarted eclipse, indexer kicked off for existing project with some good results. Then I think I changed nothing in CDT properties, just press ok, and indexer restarted and provided zero results immediately:
Usually I can reproduce it if I change anything from cdt indexer properties.

Indexer: Imported shared index for project MyProject

INDEXER START

>>> AbstractIndexerTask.indexFilesToRemove.size() 33  

>>> filesForLinkage 1746

>>> filesForLinkage 630

>>> fTaskCompleted fUrgentTasks.isEmpty()

PDOMIndexerTask fWriteInfoToLog= false

PDOMIndexerTask index= org.eclipse.cdt.internal.core.index.WritableCIndex@725e6aee

C/C++ Indexer: Project 'MyProject' (1995 sources, 4662 headers)

    Options: indexer='PDOMFastIndexer', parseAllFiles=false, unusedHeaders=skip, skipReferences=false, skipImplicitReferences=true, skipTypeReferences=false, skipMacroReferences=false.

    Database: 298389504 bytes

    Timings: 267909 total, 139177 parser, 60847 resolution, 53262 index update.

    Errors: 0 internal, 9608 include, 3 scanner, 3167 syntax errors.

    Names: 498168 declarations, 4447382 references, 543736(9.91%) unresolved.

    Cache[128MB]: 928305724 hits, 71160(0.01%) misses.

INDEXER END => Seconds 268.0

INDEXER START

>>> indexFilesToRemove.size() 0

>>> fTaskCompleted fUrgentTasks.isEmpty()

PDOMIndexerTask fWriteInfoToLog= false

PDOMIndexerTask index= org.eclipse.cdt.internal.core.index.WritableCIndex@4cc132cb

C/C++ Indexer: Project 'MyProject' (0 sources, 0 headers)

    Options: indexer='PDOMFastIndexer', parseAllFiles=false, unusedHeaders=skip, skipReferences=false, skipImplicitReferences=true, skipTypeReferences=false, skipMacroReferences=false.

    Database: 298389504 bytes

    Timings: 36 total, 0 parser, 0 resolution, 0 index update.

    Errors: 0 internal, 0 include, 0 scanner, 0 syntax errors.

    Names: 0 declarations, 0 references, 0(0.00%) unresolved.

    Cache[128MB]: 204 hits, 0(0.00%) misses.

INDEXER END => Milliseconds 37; Seconds 0.0


Thank you
Kind Regards
Lidia

On Sat, Oct 6, 2018 at 8:03 AM Marc-Andre Laperle <malaperle@xxxxxxxxx> wrote:


On Oct 5, 2018, at 7:22 AM, Lidia Popescu <lidochca@xxxxxxxxx> wrote:

Hello cdt developers, 

I am debugging cdt code and trying to understand how indexing works as I am having different issues with it.

1. Why cdt indexer returns sometimes 0 results?
e.g. Project is created indexer is kicked off, getting good results,  going to project preferences, change a configuration and getting new indexer log with 0 results:

What do you mean exactly by changing a configuration? Can you give an example? Or do you mean changing the active configuration (Debug, Release, etc)?


2. Why sometimes indexer results are not printed in .log/"Error logs". I have to add extra option (org.eclipse.cdt.core/debug/indexer=true) to be able to see indexer report in debug.
C/C++ Indexer: Project 'MyProject' (0 sources, 0 headers)
    Options: indexer='PDOMFastIndexer', parseAllFiles=false, unusedHeaders=skip, skipReferences=false, skipImplicitReferences=true, skipTypeReferences=false, skipMacroReferences=false.
    Database: 8192 bytes
    Timings: 2214 total, 0 parser, 0 resolution, 0 index update.
    Errors: 0 internal, 0 include, 0 scanner, 0 syntax errors.
    Names: 0 declarations, 0 references, 0(0.00%) unresolved.
    Cache[128MB]: 52 hits, 0(0.00%) misses.

3. Also, other issue I have is when indexer is not kicked off at all in some cases.

Which version of CDT are you using? I remember fixing a race when changing the active configuration. I might have broken something. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=375226
If you are using a version >= 8.1.0, I would try reverting that to see if it changes anything. This is just a first guess, we would still need to figure out the details.

Marc-André
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev

Back to the top