Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 103582

Summary: Indexer doesn't heed exclusion filter in CDT3.0
Product: [Tools] CDT Reporter: dharty <eclipsebugzilla>
Component: cdt-parserAssignee: Victor Lenet <victor.lenet>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: john.camelon, victor.lenet
Version: 3.0   
Target Milestone: 3.0 RC3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 72435    
Bug Blocks:    
Attachments:
Description Flags
Test Project none

Description dharty CLA 2005-07-12 19:42:46 EDT
bug 72435 provides a patch for a similar issue in CDT2, but I am having the same
(or very similar) issue in CDT3.0.

If source files are added to a folders exclusion filter, they are still indexed
by the indexer providing unneeded/unwanted errors and warnings in the problems list.

Example:

I have a project source folder with over 600 files.  I only need a fraction of
them for the project I'm working on.  (legacy system, I can't delete/move the
unneeded files).  I have added the unneeded files to the folders exclusion
filter using the file names and wildcards etc. eg:

<pathentry excluding="bootloader/MSVC/|ABORTIO.*|AC_PRM*|ACDAC6A.h|Alti.c|..."
kind="src" path="src"/>

The excluded files show up in the project as excluded, but the indexer indexes
them and provides errors and warnings for the excluded files and directories.
Comment 1 Bogdan Gheorghe CLA 2005-07-13 14:18:30 EDT
Which indexer are you seeing this with? Trying this with the Full C/C++ Indexer
worked fine; CTags it did not - but the 

What were your exact steps taken in setting up this project? At what point did
you add the exclusion filters? I suggest the following steps:

1. Create your project as you like setting indexer to No Indexer.
2. Add whatever filters you like.
3. Turn on the Full C/C++ Indexer and you whould be good to go.

Note that the CTags Indexer isn't hooked up to the exclusion filter with the
intent being that since CTags is so quick it doesn't cost much more to index
everything.
Comment 2 dharty CLA 2005-07-14 00:13:22 EDT
Created attachment 24728 [details]
Test Project
Comment 3 dharty CLA 2005-07-14 00:13:51 EDT
It was very hard to reproduce this bug without giving you all of my code, but I
have done it.

I have attached a zip file (IndexExcludes.zip) that contains the files necessary
to see this error.

There is an existing project in it that I created via the steps below.  You can
delete the project and start over using the steps, but I recommend you make a
backup of the .cdtproject file especially to keep track of the preprocessor
symbols and src excludes.  You will also need to change the "External Include"
paths to match the location of the folders on your local system.

eg, change C:/src/sandbox/etest below to wherever you unzipped the archive.

<pathentry include="C:/src/sandbox/etest/devTools/gcc/lib/isr-lib" kind="inc"
path="" system="true"/>
<pathentry include="C:/src/sandbox/etest/devTools/gcc/lib/RTL-lib" kind="inc"
path="" system="true"/>
<pathentry include="C:/src/sandbox/etest/devTools/ansi" kind="inc" path=""
system="true"/>

These project files are stored outside of my default workspace area.

   1. Create New Standard C++ make project
         1. Select external (non default path) to unzipped folder
         2. Disable Discovery Options
         3. Turn off Indexer
   2. Open Project Properties
   3. Add Preprocessor Symbols
         1. HELMSMAN
         2. GUIDO
         3. MPC555_CODE
         4. OB_MPC555_CONFIG
         5. _USE_PACK_PRAGMA
         6. AQUARIUS
         7. NOVATEL
         8. ALLOW_INFLIGHT_STATIC_PORT_SWITCH
         9. RELEASE_BUILD_TYPE
        10. HW_VER_MAJOR=1
        11. HW_VER_MINOR=1
   4. Add the following as External Include Paths (thanks to bug 103534)
         1. devTools/gcc/lib/isr-lib
         2. devTools/gcc/lib/RTL-lib
         3. devTools/ansi
   5. Set Make properties
         1. I set "dir" to replace the default make so the indexer wouldn't
complain about the files not being built, but this works with my real build
environment (gbuild).
   6. Set "src" as the "Project Source Paths"   
   7. Add the "devTools" directory to the root Project Source Paths exclusions
   8. Add the exclusion filters for the src path
         1. see the current project's filters, but at a minimum be sure to exclude
               1. CLKTIME.h
               2. FPLANIO.h
               3. Omega_Externs.h
               4. TABLEIO.h
   9. Enable Indexer
          wait
          wait
          wait (there are almost 600 files in here)
  10. You should now see that the 4 files listed above are reporting warnings
even though they are listed in the src exclusion directory.
Comment 4 Bogdan Gheorghe CLA 2005-07-15 17:22:11 EDT
Vlad can you take a look at this? It might be too late to fix this for 3.0...
Comment 5 Victor Lenet CLA 2005-07-18 12:26:43 EDT
Putting header files into project source exclusion filter will only remove them
from indexer if the header files are to be indexed on their own (after change,
save), but they will still be indexed as part of source files that include them.

If you provide a list of warning/errors we may be able to address them. Other
than that I would suggest using filters in Problems view to hide unwanted
problem markers.