Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Indexer doesn't find symbols
Indexer doesn't find symbols [message #1144398] Fri, 18 October 2013 21:26 Go to next message
Ted Middleton is currently offline Ted MiddletonFriend
Messages: 1
Registered: October 2013
Junior Member
I'm trying to figure out why Eclipse has such a problem indexing/finding so many of the symbols in my project. I'm guessing that it has something to do with the fact that I'm using a makefile project rather than using the CDT builder, but even then there are very complicated symbols that CDT seems to be able to index, while really trivial symbols seem to go missing.

Is there a general procedure to viewing or generating log output from the CDT plugin? What I'm really looking for is logging output that might tell me what's going on in CDT's indexer - and I don't see any messages in the main log file about the indexer.

Even if these symbol problems are because of pathological characteristics of my project, for me right now CDT's indexer is a black-box that just comes back with a mysterious '0 references found'. If I've inadvertently made things too difficult for the indexer, I really need some way of finding where the indexer is having problems or what it has indexed in the project.
Re: Indexer doesn't find symbols [message #1152638 is a reply to message #1144398] Thu, 24 October 2013 05:00 Go to previous messageGo to next message
Marc-André Laperle is currently offline Marc-André LaperleFriend
Messages: 256
Registered: July 2009
Senior Member
You can double check a few things. A lot of errors can go away with proper configuration. It can be pretty hard to figure out what's going on with the indexer but here is what I would do:

1. Since you are using a Makefile, make sure you are using the build output parser so that the indexer has a good amount of information about includes and symbols when parsing files. To do that, go in C/C++ General, Preprocessor Include paths..., Providers, make sure CDT GCC Build Output parser is checked. Next, make sure that you do a full build of your project and that the build output contains the includes and defines gcc flags such as -Imyincludepath -Dmydefine.

2. After the build, you might notice an "Indexing" job in the Progress view. Once it's done, try rebuilding the index entirely by right-clicking on the project, Index, Rebuild. Once that's done, some errors might get fixed but more interestingly, if you open the Error log view, you should see a report "Indexed 'project' ..." and somewhere on the line "unresolved inclusions". Make sure you have 0 unresolved inclusions. If not, right click on the project, Index, Search for unresolved includes. This will open a list of unresolved includes in the Search view. At this point the solutions might vary but you could have to add includes paths manually in project properties, C/C++ General, Preprocessor Include paths. To figure out which includes and symbols are used to parse a file, you can right-click on a source file, Index, Create parser log.

3. There might be a bug in the indexer. There are limitations to the indexer, the two most biggest ones that I've personally been affected the most are:
Headers with pragma-one semantics are indexed one version only, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=197989#c103
Index cannot maintain different typedefs with the same name, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=337583

If you don't think your errors come from either of those limitations, you can start looking at your errors one by one, try to reproduce the error in a small, self contain example and create a bug report with the version of CDT you are using. If you are working on an open source project it could be OK to just share the URL and the instructions on how to set it up but it's less likely to get looked at than a self contain, small sample code.
Re: Indexer doesn't find symbols [message #1153546 is a reply to message #1152638] Thu, 24 October 2013 17:40 Go to previous message
Marc-André Laperle is currently offline Marc-André LaperleFriend
Messages: 256
Registered: July 2009
Senior Member
This article might also be useful to you:
http://www.eclipse.org/community/eclipse_newsletter/2013/october/article4.php
Previous Topic:Debugger skips main project
Next Topic:NO include option in Project/property/Paths and Symbol
Goto Forum:
  


Current Time: Tue Apr 23 16:19:04 GMT 2024

Powered by FUDForum. Page generated in 0.03456 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top