diff --git a/build/org.eclipse.cdt.make.core/.options b/build/org.eclipse.cdt.make.core/.options new file mode 100644 index 00000000000..2b6cb4418b9 --- /dev/null +++ b/build/org.eclipse.cdt.make.core/.options @@ -0,0 +1,4 @@ +org.eclipse.cdt.make.core/debug=true + +# Reports scanner config discovery activity +org.eclipse.cdt.make.core/debug/scdiscovery=false diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java index f5665cc2c61..1a565693816 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java @@ -29,6 +29,7 @@ import org.eclipse.cdt.make.internal.core.BuildInfoFactory; import org.eclipse.cdt.make.internal.core.MakeTargetManager; import org.eclipse.cdt.make.internal.core.makefile.gnu.GNUMakefile; import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerConfigInfoFactory; +import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; @@ -40,6 +41,7 @@ import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; +import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Preferences; import org.eclipse.core.runtime.Status; @@ -318,4 +320,27 @@ public class MakeCorePlugin extends Plugin { } return null; } + + /* (non-Javadoc) + * @see org.eclipse.core.runtime.Plugin#startup() + */ + public void startup() throws CoreException { + super.startup(); + + //Set debug tracing options + configurePluginDebugOptions(); + } + + private static final String SCANNER_CONFIG = MakeCorePlugin.getUniqueIdentifier() + "/debug/scdiscovery"; //$NON-NLS-1$ + /** + * + */ + private void configurePluginDebugOptions() { + if (isDebugging()) { + String option = Platform.getDebugOption(SCANNER_CONFIG); + if (option != null) { + TraceUtil.SCANNER_CONFIG = option.equalsIgnoreCase("true") ; //$NON-NLS-1$ + } + } + } } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfoProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfoProvider.java index 44da128e778..593e737bdc5 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfoProvider.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/DiscoveredScannerInfoProvider.java @@ -10,10 +10,27 @@ **********************************************************************/ package org.eclipse.cdt.make.core.scannerconfig; +import java.io.ByteArrayOutputStream; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.FactoryConfigurationError; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + import org.eclipse.cdt.core.AbstractCExtension; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.ICDescriptor; @@ -28,10 +45,14 @@ import org.eclipse.cdt.make.internal.core.scannerconfig.util.SymbolEntry; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.QualifiedName; +import org.eclipse.core.runtime.Status; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; +import org.xml.sax.SAXException; /** * Provider of both user specified and discovered scanner info @@ -124,7 +145,8 @@ public class DiscoveredScannerInfoProvider extends AbstractCExtension implements private DiscoveredScannerInfo loadScannerInfo(IProject project) throws CoreException { LinkedHashMap includes = new LinkedHashMap(); LinkedHashMap symbols = new LinkedHashMap(); - loadDiscoveredScannerInfoFromCDescriptor(project, includes, symbols); +// loadDiscoveredScannerInfoFromCDescriptor(project, includes, symbols); + loadDiscoveredScannerInfoFromState(project, includes, symbols); MakeScannerInfo userInfo = MakeScannerProvider.getDefault().loadScannerInfo(project); DiscoveredScannerInfo info = new DiscoveredScannerInfo(project); info.setUserScannerInfo(userInfo); @@ -143,6 +165,15 @@ public class DiscoveredScannerInfoProvider extends AbstractCExtension implements private void loadDiscoveredScannerInfoFromCDescriptor(IProject project, LinkedHashMap includes, LinkedHashMap symbols) throws CoreException { ICDescriptor descriptor = CCorePlugin.getDefault().getCProjectDescription(project); Node child = descriptor.getProjectData(CDESCRIPTOR_ID).getFirstChild(); + loadDiscoveredScannerInfo(includes, symbols, child); + } + + /** + * @param includes + * @param symbols + * @param child + */ + private void loadDiscoveredScannerInfo(LinkedHashMap includes, LinkedHashMap symbols, Node child) { while (child != null) { if (child.getNodeName().equals(INCLUDE_PATH)) { // Add the path to the property list @@ -152,7 +183,7 @@ public class DiscoveredScannerInfoProvider extends AbstractCExtension implements // Add the symbol to the symbol list String symbol = ((Element)child).getAttribute(SYMBOL); String removed = ((Element)child).getAttribute(REMOVED); - boolean bRemoved = (removed != null && removed == "true"); //$NON-NLS-1$ + boolean bRemoved = (removed != null && removed.equals("true")); // $NON-NLS-1$ ScannerConfigUtil.scAddSymbolString2SymbolEntryMap(symbols, symbol, !bRemoved); } child = child.getNextSibling(); @@ -193,7 +224,8 @@ public class DiscoveredScannerInfoProvider extends AbstractCExtension implements project.setSessionProperty(scannerInfoProperty, scannerInfo); } - saveDiscoveredScannerInfoToCDescriptor(scannerInfo, project); +// saveDiscoveredScannerInfoToCDescriptor(scannerInfo, project); + saveDiscoveredScannerInfoToState(scannerInfo, project); MakeScannerProvider.updateScannerInfo(scannerInfo.getUserScannerInfo()); // listeners are notified by MakeScannerProvider.updateScannerInfo @@ -218,11 +250,20 @@ public class DiscoveredScannerInfoProvider extends AbstractCExtension implements rootElement.removeChild(child); child = rootElement.getFirstChild(); } + Document doc = rootElement.getOwnerDocument(); + saveDiscoveredScannerInfo(scannerInfo, rootElement, doc); + } + + /** + * @param scannerInfo + * @param rootElement + * @param doc + */ + private static void saveDiscoveredScannerInfo(DiscoveredScannerInfo scannerInfo, Element rootElement, Document doc) { // Save the build info if (scannerInfo != null) { // Serialize the include paths - Document doc = rootElement.getOwnerDocument(); Map discoveredIncludes = scannerInfo.getDiscoveredIncludePaths(); Iterator iter = discoveredIncludes.keySet().iterator(); while (iter.hasNext()) { @@ -259,4 +300,87 @@ public class DiscoveredScannerInfoProvider extends AbstractCExtension implements // descriptor.saveProjectData(); } } -} \ No newline at end of file + + private void loadDiscoveredScannerInfoFromState(IProject project, LinkedHashMap includes, LinkedHashMap symbols) throws CoreException { + // Save the document + IPath path = MakeCorePlugin.getWorkingDirectory(); + path = path.append(project.getName() + ".sc"); + if (path.toFile().exists()) { + try { + FileInputStream file = new FileInputStream(path.toFile()); + DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + Document document = parser.parse(file); + Node rootElement = document.getFirstChild(); + if (rootElement.getNodeName().equals("scannerInfo")) { + Node child = rootElement.getFirstChild(); + loadDiscoveredScannerInfo(includes, symbols, child); + } + } catch (IOException e) { + throw new CoreException(new Status(IStatus.ERROR, + MakeCorePlugin.getUniqueIdentifier(), -1, + MakeCorePlugin.getResourceString("GCCScannerConfigUtil.Error_Message"), e)); //$NON-NLS-1$ + } catch (ParserConfigurationException e) { + MakeCorePlugin.log(e); + } catch (FactoryConfigurationError e) { + MakeCorePlugin.log(e); + } catch (SAXException e) { + MakeCorePlugin.log(e); + } + } + } + + private static void saveDiscoveredScannerInfoToState(DiscoveredScannerInfo scannerInfo, IProject project) throws CoreException { + // Create document + try { + DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + Document doc = builder.newDocument(); + Element rootElement = doc.createElement("scannerInfo"); + rootElement.setAttribute("id", CDESCRIPTOR_ID); + doc.appendChild(rootElement); + + saveDiscoveredScannerInfo(scannerInfo, rootElement, doc); + + // Transform the document to something we can save in a file + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + Transformer transformer = TransformerFactory.newInstance().newTransformer(); + transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$ + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ + DOMSource source = new DOMSource(doc); + StreamResult result = new StreamResult(stream); + transformer.transform(source, result); + + // Save the document + IPath path = MakeCorePlugin.getWorkingDirectory(); + path = path.append(project.getName() + ".sc"); + try { + FileOutputStream file = new FileOutputStream(path.toFile()); + file.write(stream.toByteArray()); + file.close(); + } catch (IOException e) { + throw new CoreException(new Status(IStatus.ERROR, + MakeCorePlugin.getUniqueIdentifier(), -1, + MakeCorePlugin.getResourceString("GCCScannerConfigUtil.Error_Message"), e)); //$NON-NLS-1$ + } + + // Close the streams + stream.close(); + } catch (ParserConfigurationException e) { + MakeCorePlugin.log(e); + } catch (FactoryConfigurationError e) { + MakeCorePlugin.log(e); + } catch (TransformerConfigurationException e) { + MakeCorePlugin.log(e); + } catch (TransformerFactoryConfigurationError e) { + MakeCorePlugin.log(e); + } catch (TransformerException e) { + MakeCorePlugin.log(e); + } catch (IOException e) { + MakeCorePlugin.log(e); + } catch (CoreException e) { + // Save to IFile failed + MakeCorePlugin.log(e.getStatus()); + } + + } +} diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigBuilder.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigBuilder.java index f4ae72758d6..035ce3445e9 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigBuilder.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/scannerconfig/ScannerConfigBuilder.java @@ -36,10 +36,23 @@ public class ScannerConfigBuilder extends ACBuilder { * @see IncrementalProjectBuilder#build */ protected IProject [] build(int kind, Map args, IProgressMonitor monitor) throws CoreException { - monitor.beginTask("", 100); //$NON-NLS-1$ - monitor.subTask(MakeCorePlugin.getResourceString("ScannerConfigBuilder.Invoking_Builder") + //$NON-NLS-1$ - getProject().getName()); - ScannerInfoCollector.getInstance().updateScannerConfiguration(getProject(), new SubProgressMonitor(monitor, 100)); + // If auto discovery is disabled, do nothing + boolean autodiscoveryEnabled; + try { + IScannerConfigBuilderInfo buildInfo = MakeCorePlugin.createScannerConfigBuildInfo(getProject(), BUILDER_ID); + autodiscoveryEnabled = buildInfo.isAutoDiscoveryEnabled(); + } + catch (CoreException e) { + // builder not installed or disabled + autodiscoveryEnabled = false; + } + + if (autodiscoveryEnabled) { + monitor.beginTask("ScannerConfigBuilder.Invoking_Builder", 100); //$NON-NLS-1$ + monitor.subTask(MakeCorePlugin.getResourceString("ScannerConfigBuilder.Invoking_Builder") + //$NON-NLS-1$ + getProject().getName()); + ScannerInfoCollector.getInstance().updateScannerConfiguration(getProject(), new SubProgressMonitor(monitor, 100)); + } return getProject().getReferencedProjects(); } } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerInfoConsoleParserFactory.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerInfoConsoleParserFactory.java index 6916dfb64f6..00bdc78a6b8 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerInfoConsoleParserFactory.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/ScannerInfoConsoleParserFactory.java @@ -75,8 +75,15 @@ public class ScannerInfoConsoleParserFactory { try { // get the SC builder settings if (currentProject.hasNature(ScannerConfigNature.NATURE_ID)) { - IScannerConfigBuilderInfo scBuildInfo = MakeCorePlugin. - createScannerConfigBuildInfo(currentProject, ScannerConfigBuilder.BUILDER_ID); + IScannerConfigBuilderInfo scBuildInfo; + try { + scBuildInfo = MakeCorePlugin. + createScannerConfigBuildInfo(currentProject, ScannerConfigBuilder.BUILDER_ID); + } + catch (CoreException e) { + // builder not installed or disabled + scBuildInfo = null; + } if (scBuildInfo != null && scBuildInfo.isMakeBuilderConsoleParserEnabled()) { // get the make builder console parser IScannerInfoConsoleParser clParser = MakeCorePlugin.getDefault(). diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java index 5013ee2f01f..290aa167ac6 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCScannerInfoConsoleParser.java @@ -14,7 +14,6 @@ import java.util.StringTokenizer; import org.eclipse.cdt.core.CCProjectNature; import org.eclipse.cdt.core.CProjectNature; -import org.eclipse.cdt.core.IMarkerGenerator; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; @@ -23,9 +22,9 @@ import org.eclipse.cdt.make.core.MakeCorePlugin; import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser; import org.eclipse.cdt.make.internal.core.scannerconfig.IScannerInfoConsoleParserUtility; import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoCollector; +import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; /** @@ -105,16 +104,31 @@ public class GCCScannerInfoConsoleParser implements IScannerInfoConsoleParser { rc = true; String fileName = null; - String desc = "Found"; while (scanner.hasMoreTokens()) { token = scanner.nextToken(); if (token.startsWith("-D")) {//$NON-NLS-1$ String symbol = token.substring(2); + if (symbol.length() == 0) { + if (scanner.hasMoreTokens()) { + symbol = scanner.nextToken(); + } + else { + continue; + } + } if (!symbols.contains(symbol)) symbols.add(symbol); } else if (token.startsWith("-I")) {//$NON-NLS-1$ String iPath = token.substring(2); + if (iPath.length() == 0) { + if (scanner.hasMoreTokens()) { + iPath = scanner.nextToken(); + } + else { + continue; + } + } String nPath = fUtil.normalizePath(iPath); if (!includes.contains(nPath)) includes.add(nPath); @@ -146,35 +160,29 @@ public class GCCScannerInfoConsoleParser implements IScannerInfoConsoleParser { IProject project = fProject; IFile file = null; + List translatedIncludes = includes; if (includes.size() > 0) { if (fileName != null) { file = fUtil.findFile(fileName); if (file != null) { project = file.getProject(); - includes = fUtil.translateRelativePaths(file, fileName, includes); + translatedIncludes = fUtil.translateRelativePaths(file, fileName, includes); } } else { - fUtil.generateMarker(fProject, -1, "Unable to find file name: " + line, - IMarkerGenerator.SEVERITY_ERROR_RESOURCE, null); + TraceUtil.outputError("Unable to find file name: ", line); //$NON-NLS-1$ +// fUtil.generateMarker(fProject, -1, "Unable to find file name: " + line, //$NON-NLS-1$ +// IMarkerGenerator.SEVERITY_ERROR_RESOURCE, null); } } // Contribute discovered includes and symbols to the ScannerInfoCollector - ScannerInfoCollector.getInstance(). - contributeToScannerConfig(project, includes, symbols, targetSpecificOptions); - - // TODO : VMIR remove when debugging is done - int severity = IMarkerGenerator.SEVERITY_INFO; - - for (Iterator i = includes.iterator(); i.hasNext(); ) { - String iPath = (String)i.next(); - fUtil.generateMarker(file, -1, "Found an include path: "+iPath, severity, iPath); + if (translatedIncludes.size() > 0 || symbols.size() > 0) { + ScannerInfoCollector.getInstance(). + contributeToScannerConfig(project, translatedIncludes, symbols, targetSpecificOptions); + + TraceUtil.outputTrace("Discovered scanner info for file \'" + fileName + '\'', //$NON-NLS-1$ + "Include paths", includes, translatedIncludes, "Defined symbols", symbols); //$NON-NLS-1$ //$NON-NLS-2$ } - for (Iterator i = symbols.iterator(); i.hasNext(); ) { - String symbol = (String)i.next(); - fUtil.generateMarker(file, -1, "Found a symbol definition: "+symbol, severity, symbol); - } - } return rc; } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java index 96a9a929fd7..0e0c2a62371 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/gnu/GCCSpecsConsoleParser.java @@ -17,6 +17,7 @@ import java.util.StringTokenizer; import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoConsoleParser; import org.eclipse.cdt.make.internal.core.scannerconfig.IScannerInfoConsoleParserUtility; import org.eclipse.cdt.make.internal.core.scannerconfig.ScannerInfoCollector; +import org.eclipse.cdt.make.internal.core.scannerconfig.util.TraceUtil; import org.eclipse.core.resources.IProject; /** @@ -94,7 +95,9 @@ public class GCCSpecsConsoleParser implements IScannerInfoConsoleParser { } ScannerInfoCollector.getInstance().contributeToScannerConfig(project, includes, symbols, null); - + TraceUtil.outputTrace("Scanner info from \'specs\' file", //$NON-NLS-1$ + "Include paths", includes, new ArrayList(), "Defined symbols", symbols); //$NON-NLS-1$ //$NON-NLS-2$); + return rc; } diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/TraceUtil.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/TraceUtil.java new file mode 100644 index 00000000000..16d4689957e --- /dev/null +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/util/TraceUtil.java @@ -0,0 +1,76 @@ +/********************************************************************** + * Copyright (c) 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM - Initial API and implementation + **********************************************************************/ +package org.eclipse.cdt.make.internal.core.scannerconfig.util; + +import java.util.Iterator; +import java.util.List; + +/** + * Tracebility related utility functions + * + * @author vhirsl + */ +public class TraceUtil { + public static boolean SCANNER_CONFIG = false; + + public static boolean isTracing() { + return SCANNER_CONFIG; + } + + public static void outputTrace(String prefix, String msg, String postfix) { + System.out.println(prefix + ' ' + msg + ' ' + postfix); + } + + /** + * For traces of type: + * Title: + * Subtitle1: + * item1[0] + * item1[1] + * ... + * Subtitle2: + * item2[0] + * item2[1] + * ... + * @param title + * @param col1 + * @param col2 + */ + public static void outputTrace(String title, String subtitle1, List item1, List item1new, String subtitle2, List item2) { + if (isTracing()) { + System.out.println(); + System.out.println(title); + final String prefix = " "; //$NON-NLS-1$ + final String doublePrefix = " "; //$NON-NLS-1$ + System.out.println(prefix + subtitle1 + " (" + item1.size() + "):"); //$NON-NLS-1$ //$NON-NLS-2$ + int count = 0; + for (Iterator i = item1.iterator(), j = item1new.iterator(); i.hasNext(); ) { + System.out.println(doublePrefix + String.valueOf(++count) + "\t\'" +(String)i.next() + (j.hasNext()?"\' -> \'" + (String)j.next():"") + '\''); //$NON-NLS-1$ //$NON-NLS-2$ + } + System.out.println(prefix + subtitle2 + " (" + item2.size() + "):"); //$NON-NLS-1$ + count = 0; + for (Iterator i = item2.iterator(); i.hasNext(); ) { + System.out.println(doublePrefix + String.valueOf(++count) + "\t\'" + (String)i.next() + '\''); //$NON-NLS-1$ + } + } + } + + /** + * @param string + * @param line + */ + public static void outputError(String string, String line) { + if (isTracing()) { + System.out.println(); + System.out.println("Error: " + string + line); //$NON-NLS-1$ + } + } +} \ No newline at end of file diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildPathInfoBlock.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildPathInfoBlock.java index 4b560e75cb3..18dc12e04d8 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildPathInfoBlock.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/BuildPathInfoBlock.java @@ -228,7 +228,12 @@ public class BuildPathInfoBlock extends AbstractCOptionPage { } // First store scanner config options if (scOptionsDialog.isInitialized()) { - scOptionsDialog.performApply(monitor); + try { + scOptionsDialog.performApply(monitor); + } + catch (CoreException e) { + // builder was disabled while scOptionsDialog was initialized + } } IProject project = getContainer().getProject(); diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/ScannerConfigOptionsDialog.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/ScannerConfigOptionsDialog.java index 434becab873..9cb107aa0a8 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/ScannerConfigOptionsDialog.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/ScannerConfigOptionsDialog.java @@ -202,7 +202,7 @@ public class ScannerConfigOptionsDialog extends Dialog { fInfo = MakeCorePlugin.createScannerConfigBuildInfo(project, ScannerConfigBuilder.BUILDER_ID); } catch (CoreException e) { -// fInitialized = false; + fInitialized = false; fInfo = MakeCorePlugin.createScannerConfigBuildInfo(fPrefs, ScannerConfigBuilder.BUILDER_ID, true); } }