Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Path and Symbol Discovery from ClearCase config records

Hi all,

I'm, currently trying to obtain the paths and symbols for makefile projects from clearcase config records instead of the build console output.
 
There is a problem I run into, and I would appreciate any kind of advice.

Here is what I do:

- I wrote an IResourceChangeListener that watches out for object files

- The found object files are passed to a workspace job, doing the following:
  - obtain the clearcase config records of each object file
  - determine the include paths and preprocessor symbols from the config records
  - Store the found paths and symbols in the DiscoveryManager (as it is done in PerProjectSICollector does).
  - run the ScannerConfigBuilder

- Since C and C++ are mixed in my projects, are created extensions of org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile, one for C and one for C++ denoting the specs file explicitly (The default GCCStandardMakePerFileProfile has a bug - both C and C++ end up with the same built-in symbols and paths). Furthermore, reading the build output is omitted.

   <extension
         id="com.verigy.cpp.CClearCaseCRPerProjectProfile"
         name="C ClearCase Config Records Per Project"
         point="org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile">
      <scannerInfoCollector
            class="org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector"
            scope="project"/>
      <scannerInfoProvider providerId="specsFile">
         <run
               command="gcc"
               arguments="-E -P -v -dD ${plugin_state_location}/specs.c"
               class="org.eclipse.cdt.make.internal.core.scannerconfig2.GCCSpecsRunSIProvider"/>
         <scannerInfoConsoleParser class="org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCSpecsConsoleParser"/>
      </scannerInfoProvider>
   </extension>

The one for C++ is analogous.

- I defined my own tools chain just subclassing the gnu linux tools chains, Such that the profiles above are selected automatically when creating the projects.


I actually works pretty good. Just, sometimes after closing and opening the the workbench, the discovered symbols and paths are not read back from the scanner configuration file stored in the .metadata/.plugins/org.eclipse.cdt.make.core/<project>.sc. The properties dialog does not show any path or symbol anymore, and the next build then clear the scanner config file in the workspace and rewrites it, such that only the compiler built-ins are available any longer.

Here my question(s):
- Is the DiscoveryManager meant to be used for this purpose? I cannot use the C project description, since the .cproject files are checked in into revision control once the projects are created.

- The problem seems to occur after I imported the project, then close the workbench and open it later. Where can a look for the code that should read the scanner config file from the workspace in order to debug it?\

- Are there any known bugs in this area (DiscoveryManager, Makefile projects)?

- Are there any events that completely clear the discovered info? In this case, the ResourceChangeListener does cannot work either.

Thanks for any kind of advice; the feature is too valuable for us to be dropped.

Jens.


Back to the top