Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Trying to implement a scanner configurationdiscoveryprofile


                Success!  Wow, thanks Steve – that would have undoubtedly taken me days to work out on my own. Glad to know that I’m not alone ;)  In case others run into this thread later on down the road the only amendment that I’ll make is that I’m guessing that you are referring to IPerFileDiscoveredPathInfo2 rather than IDiscoveredPathInfo2 below.  Once I worked that bit out everything seemed to work just fine in 6.0 M6.


                Thanks again!



From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Kennedy, Stephen M (Steve)
Sent: Thursday, May 07, 2009 3:40 PM
To: CDT General developers list.
Subject: RE: [cdt-dev] Trying to implement a scanner configurationdiscoveryprofile




I've gotten a "per file" ScannerInfoCollector (attribute scope="file") to work at least.  Looking at my code, I see I added a comment on "getCollectedScannerInfo()": "NOTE: not called so far..." :).  My ScannerInfoCollector class implements IScannerInfoCollector3.  The key part is the IScannerInfoCollector2 interface which has a createPathInfoObject() method that returns an object implementing the IDiscoveredPathManager.IDiscoveredPathInfo interface.  For this object I implemented the IDiscoveredPathManager.IDiscoveredPathInfo2 interface instead.  The IDiscoveredPathInfo2 has a getPathInfoMap() method which returns a map of IResource -> PathInfo (this object has the include path & preprocessor definitions).  Whew.  As far as I can tell none of the other methods in IDiscoveredPathInfo2 are called aside from getSerializable().  I implemented this originally in 4.x but it is still working in 5.0.2 and I think it still worked in 6.0 M4).


Hope this helps.


Steve Kennedy

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Anderson, Glen
Sent: Thursday, May 07, 2009 1:58 PM
To: CDT General developers list.
Subject: [cdt-dev] Trying to implement a scanner configuration discoveryprofile

                Hi all,


                Currently I’m trying to implement a plugin that adds built-in include paths, library paths and preprocessor definitions to the Paths and Symbols preference page in our CDT based product (currently developing against 6.0 M6).  From the (likely outdated) documentation that I’ve been able to find it seems like extending the org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile extension point and providing my own implementation of IScannerInfoCollector and IScannerInfoProvider is the way to go.


                Having done that I can see that my provider is being called appropriately and is adding the correct information to the collector.  The problem that I’m seeing is that at no point is IScannerInfoCollector.getCollectedScannerInfo() ever called.  Grepping through the entire CDT source tree seems to reveal that there are only two instances of this method being called, both of which are in internal GCC related implementations and neither of which are actually asking for ScannerInfoTypes.INCLUDE_PATHS or ScannerInfoTypes.SYMBOL_DEFINITIONS.


                Has this mechanism been deprecated or is there maybe something else that I’m missing?  Does anyone know of a better way to accomplish this?




Back to the top