1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

This patch fixes:

1. PR 62349: [Managed Build] Funny include paths - added -P option to
'generate scanner info command' to suppress line numbering
2. Account for simple gcc names like: gcc.c2.95.3-p10.mips64
3. Exporting make.core plugin's .options file as a part of binaries.
Customers now can turn scanner config discovery debugging on or off.
This commit is contained in:
Sean Evoy 2004-05-18 18:59:34 +00:00
parent 09fd1318d0
commit f909efeb3c
9 changed files with 18 additions and 11 deletions

View file

@ -3,8 +3,9 @@ bin.includes = plugin.xml,\
cdtmakecore.jar,\
*.html,\
plugin.properties,\
schema/,\
builtin/
builtin/,\
.options,\
schema/
src.includes = builtin/,\
src/,\
schema/

View file

@ -119,7 +119,7 @@
</parameter>
<parameter
name="defaultAttributes"
value="-E -v ${plugin_state_location}/${specs_file}">
value="-E -P -v ${plugin_state_location}/${specs_file}">
</parameter>
</run>
</externalScannerInfoProvider>

View file

@ -129,7 +129,7 @@ public class MakeCorePlugin extends Plugin {
scInfo.setESIProviderCommandEnabled(true);
scInfo.setUseDefaultESIProviderCmd(true);
scInfo.setESIProviderCommand(new Path("gcc")); //$NON-NLS-1$
scInfo.setESIProviderArguments("-E -v ${plugin_state_location}/${specs_file}"); //$NON-NLS-1$
scInfo.setESIProviderArguments("-E -P -v ${plugin_state_location}/${specs_file}"); //$NON-NLS-1$
scInfo.setESIProviderConsoleParserId(GCC_SPECS_CONSOLE_PARSER_ID);
scInfo.setMakeBuilderConsoleParserId(GCC_SCANNER_INFO_CONSOLE_PARSER_ID);
} catch (CoreException e) {

View file

@ -32,6 +32,7 @@ import org.eclipse.cdt.make.internal.core.MakeMessages;
import org.eclipse.cdt.make.internal.core.StreamMonitor;
import org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCScannerConfigUtil;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.ScannerConfigUtil;
import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@ -99,6 +100,7 @@ public class DefaultExternalScannerInfoProvider implements IExternalScannerInfoP
OutputStream sniffer = ScannerInfoConsoleParserFactory.getESIProviderOutputSniffer(
cos, currentProject, buildInfo, collector);
TraceUtil.outputTrace("Default provider running command:", fCompileCommand.toString() + ca, ""); //$NON-NLS-1$ //$NON-NLS-2$
Process p = launcher.execute(fCompileCommand, compileArguments, setEnvironment(launcher), fWorkingDirectory);
if (p != null) {
try {
@ -157,7 +159,7 @@ public class DefaultExternalScannerInfoProvider implements IExternalScannerInfoP
//TODO VMIR better error handling
MakeCorePlugin.log(e.getStatus());
}
IPath path2File = fWorkingDirectory.append(targetFile);
IPath path2File = MakeCorePlugin.getWorkingDirectory().append(targetFile);
if (!path2File.toFile().exists()) {
GCCScannerConfigUtil.createSpecs();
}

View file

@ -166,7 +166,7 @@ public class ScannerConfigInfoFactory {
if (isDefaultESIProviderCmd()) {
String attributes = getESIProviderParameter("defaultAttributes"); //$NON-NLS-1$
if (attributes == null) {
attributes = "-E -v ${plugin_state_location}/{specs_file}"; //$NON-NLS-1$
attributes = "-E -P -v ${plugin_state_location}/{specs_file}"; //$NON-NLS-1$
}
return attributes;
}

View file

@ -61,7 +61,7 @@ public class ScannerInfoCollector implements IScannerInfoCollector {
// cumulative values
private Map sumDiscoveredIncludes;
private Map sumDiscoveredSymbols;
private Map sumDiscoveredTSO; // target specific options
// private Map sumDiscoveredTSO; // target specific options
private IProject currentProject; // project being built
@ -72,7 +72,7 @@ public class ScannerInfoCollector implements IScannerInfoCollector {
sumDiscoveredIncludes = new HashMap();
sumDiscoveredSymbols = new HashMap();
sumDiscoveredTSO = new HashMap();
// sumDiscoveredTSO = new HashMap();
}
public static ScannerInfoCollector getInstance() {
@ -250,7 +250,7 @@ public class ScannerInfoCollector implements IScannerInfoCollector {
// Step 4. Set resulting scanner config
discScanInfo.setDiscoveredIncludePaths(newPersistedIncludes);
// Step 5. Invalidate discovered include paths and symbol definitions
// Step 5. Invalidate discovered include paths
discoveredIncludes.put(projectName, null);
}
return addedIncludes;
@ -286,7 +286,7 @@ public class ScannerInfoCollector implements IScannerInfoCollector {
// Step 4. Set resulting scanner config
discScanInfo.setDiscoveredSymbolDefinitions(candidateSymbols);
// Step 5. Invalidate discovered include paths and symbol definitions
// Step 5. Invalidate discovered symbol definitions
discoveredSymbols.put(projectName, null);
}
return addedSymbols;

View file

@ -51,6 +51,7 @@ public class GCCScannerInfoConsoleParser implements IScannerInfoConsoleParser {
*/
public boolean processLine(String line) {
boolean rc = false;
TraceUtil.outputTrace("GCCScannerInfoConsoleParser parsing line:", TraceUtil.EOL, line); //$NON-NLS-1$ //$NON-NLS-2$
// make\[[0-9]*\]: error_desc
int firstColon= line.indexOf(':');
String make = line.substring(0, firstColon + 1);
@ -75,7 +76,7 @@ public class GCCScannerInfoConsoleParser implements IScannerInfoConsoleParser {
return false;
Iterator I = allTokens.iterator();
String token = ((String) I.next()).toLowerCase();
if (token.endsWith("gcc") || token.endsWith("g++")) {//$NON-NLS-1$ //$NON-NLS-2$
if (token.indexOf("gcc") != -1 || token.indexOf("g++") != -1) {//$NON-NLS-1$ //$NON-NLS-2$
// Recognized gcc or g++ compiler invocation
List includes = new ArrayList();
List symbols = new ArrayList();

View file

@ -55,6 +55,7 @@ public class GCCSpecsConsoleParser implements IScannerInfoConsoleParser {
*/
public boolean processLine(String line) {
boolean rc = false;
TraceUtil.outputTrace("GCCSpecsConsoleParser parsing line:", TraceUtil.EOL, line); //$NON-NLS-1$ //$NON-NLS-2$
// Known patterns:
// (a) gcc|g++ ... -Dxxx -Iyyy ...
switch (state) {

View file

@ -19,6 +19,7 @@ import java.util.List;
* @author vhirsl
*/
public class TraceUtil {
public static final String EOL = System.getProperty("line.separator");
public static boolean SCANNER_CONFIG = false;
public static boolean isTracing() {
@ -26,6 +27,7 @@ public class TraceUtil {
}
public static void outputTrace(String prefix, String msg, String postfix) {
System.out.println();
System.out.println(prefix + ' ' + msg + ' ' + postfix);
}