Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Per File Scanner Discovery

Hi Doug!
 
It works fine for me, but maybe because I have a patched version. I told
you about my patch recently.
 
Maybe the scanner config builder does not run or it is run before the
actual build. In either case the scanner config info is not propagated
correctly.
 
Here a simplified call tree of what the per file scanner discovery
usually does:
 
Actual build run:
<any builder>.build(...); // e.g. MakeBuilder.build
for each build output line:
  ConsoleOutputSniffer.processLine(String line);
 
GCCPerFileBOPConsoleParser<AbstractGCCBOPConsoleParser>.processLine(Stri
ng line);
      GCCPerFileBOPConsoleParser.processSingleLine(String line);
        cmd = GCCPerFileBOPConsoleParser.fUtil.getNewCCommandDSC(...);
        sc.put(COMPILER_COMMAND, <list of cmd>);
        PerFileSICollector.contributeToScannerConfig(IFile file, Map
sc);
          for each cmd in sc:
            PerFileSICollector.addCompilerCommand(cmd, ...);
              commandid = ...;
              PerFileSICollector.sid.commandIdCommandMap.put(commandid,
cmd);
 
Scanner config builder run:
ScannerConfigBuilder.build(...);
  SCDMakeFileGenerator.initialize();  // generate make file to discover
compiler internal settings per file set
  SCDMakeFileGenerator<DefaultRunSIProvider>.invokeProvider(...);
    for each build output line:
      ConsoleOutputSniffer.processLine(String line);
        GCCPerFileSIPConsoleParser.processLine(String line);
          commandid = ...;  // get command id per file set from build
output
          sc = ...; // collect scanner config from build output
          PerFileSICollector.contributeToScannerConfig(int commandid,
Map sc);
            PerFileSICollector.addScannerInfo(int commandid, Map sc)
              cmd =
PerFileSICollector.sid.commandIdCommandMap.get(commandid)
              cmd.setIncludes(sc.get(INCLUDE_PATHS));
              cmd.setSymbols(sc.get(SYMBOL_DEFINITIONS));
              cmd.setDiscovered(true);
SCJobsUtil.updateScannerConfiguration(...)
  PerFileSICollector.updateScannerConfiguration(...)
    PerFileSICollector.applyFileDeltas();
 
MakeCorePlugin.getDefault().getDiscoveryManager().updateDiscoveredInfo()
;
 
Both, the actual build and a subsequent scanner config builder run are
required (in the unpatched scanner discovery). It also requires a
correct configuration of a scanner discovery profile.

Here a possible per file scanner discovery extension:

<extension id="StandardMakePerFileProfile"
name="%perFileScannerInfoProfileExtensionName"
point="org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile">
  <scannerInfoCollector
class="org.eclipse.cdt.make.internal.core.scannerconfig2.PerFileSICollec
tor" scope="file"/>

  <buildOutputProvider>
    <open/>
    <scannerInfoConsoleParser
class="org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCPerFileBO
PConsoleParser" compilerCommands="gcc,g++,dcc,cpp,c++,cc"/>
  </buildOutputProvider>

  <scannerInfoProvider providerId="compilerBuiltinProvider">
    <run
class="com.windriver.ide.staticanalysis.core.scannerdiscovery.SACompiler
BuiltinProvider"/>
    <scannerInfoConsoleParser
class="com.windriver.ide.staticanalysis.core.scannerdiscovery.SACompiler
BuiltinConsoleParser" compilerCommands="gcc,g++,dcc,cpp,c++,cc"/>
  </scannerInfoProvider>
</extension>


See
org.eclipse.cdt.make.core.scannerconfig.ScannerConfigNature.initializeDi
scoveryOptions to find out how scanner discovery profile settings are
applied to different configurations.

BTW, could anyone apply my scanner discovery patch or at least have a
look at it before RC0 and apply a part of it? It is bug #156008.

Best regards,

    Gerhard

________________________________

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Doug Schaefer
Sent: Montag, 23. April 2007 21:43
To: CDT General developers list.
Subject: [cdt-dev] Per File Scanner Discovery



	Hey,

	 

	Does anyone have per file scanner discovery working? I can't
seem to figure out how to. If it's not, I'd like to try and fix it but
I'm may just be doing it wrong. I set my discovery profiles scope to
Configuration-wide and select the GCC per file scanner info profile as
my profile. I have a pre-built build log file that I then load. This is
with cygwin. The CommandDSC seems to pick out the options correctly, but
I don't see where it's getting added to the project. For that matter I'm
not sure where it's supposed to get added.

	 

	Help....

	 

	BTW, this is holding up my Firefox indexer performance testing.

	 

	Doug Schaefer, QNX Software Systems
	Eclipse CDT Project Lead, http://cdtdoug.blogspot.com

	 



Back to the top