[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [cdt-dev] 'Debugging' the C++ indexer
|
Content assist provides macros, only if they are defined in
one of the header files (directly or indirectly) included by
the current file in the editor. You can use the
include-browser to figure out what files are actually
included.
Attached you find my recommondations on how to deal with
indexing problems. Dealing with indexing problems
Markus.
I've been using CDT recently for development. I'm seeing some
inconsistencies with the indexer, and am looking for some debug output that
would help me better-characterize the issues I'm encountering. Any tips on how
to understand what the indexer did, what symbols it found, and what errors it
encountered would be most appreciated.
The core problem I'm seeing
today appears to be that macros from one header file (file1) aren't provided
by the C++ editor content-assist, while macros from other header files are
provided by the C++ editor content assist. Other symbols from file1 (class
name, class members, etc) are provided by the C++ editor content assist. This
leads me to believe that the indexer somehow failed to parse these macro
definitions.
In a previous version of CDT, it was possible to turn on
error reporting from the indexer. I don't see a way to enable this feature in
CDT 4.0. Was this feature removed in 4.0?
Thanks and Best
Regards,
Matthew
What you can do is:
(a) look at a file and check the following:
- are there problems resolving the includes (warning markers)?
use the Include Browser to check headers that are included indirectly.
- does the parser report syntax errors (warning markers)?
- is the symbol in question used in active code (not #ifdef'ed)
- you can turn on highlighting of problems (which basically highlights
names where the name-resolution failed): Preferences - Editor - Syntax
Coloring - Problems
(b) You can trace CDT to see
- what files are actually indexed
- a statistics about unresolved includes and problems in the resolution.
- a listing of all name-resolution problems
Tracing the CDT indexer:
* use command line option -debug <options-file>
* put the following in the options file:
# turns on tracing for the cdt-core plugin
org.eclipse.cdt.core/debug=true
# Reports statistics for indexer
org.eclipse.cdt.core/debug/indexer/statistics=true
# Reports when and which files get indexed
org.eclipse.cdt.core/debug/indexer/activity=true
# Reports problems for indexer
org.eclipse.cdt.core/debug/indexer/problems=false