diff --git a/core/org.eclipse.cdt.core.native/.options b/core/org.eclipse.cdt.core.native/.options new file mode 100644 index 00000000000..77eda67bb6f --- /dev/null +++ b/core/org.eclipse.cdt.core.native/.options @@ -0,0 +1,4 @@ +org.eclipse.cdt.core.native/debug=false + +# Used by org.eclipse.cdt.core.win32 fragment +org.eclipse.cdt.core.native/debug/win32/registry=false \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.native/build.properties b/core/org.eclipse.cdt.core.native/build.properties index 006a08c7bcb..641b4f3e264 100644 --- a/core/org.eclipse.cdt.core.native/build.properties +++ b/core/org.eclipse.cdt.core.native/build.properties @@ -20,7 +20,8 @@ bin.includes = plugin.properties,\ about.mappings,\ cdt_logo_icon32.png,\ about.properties,\ - plugin.xml + plugin.xml,\ + .options src.includes = about.html,\ schema/,\ native_src/ diff --git a/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/WindowsRegistryImpl.java b/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/WindowsRegistryImpl.java index dcb48a8fc7b..0327dbffcf9 100644 --- a/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/WindowsRegistryImpl.java +++ b/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/WindowsRegistryImpl.java @@ -15,6 +15,7 @@ package org.eclipse.cdt.internal.core.win32; import org.eclipse.cdt.internal.core.natives.CNativePlugin; import org.eclipse.cdt.utils.WindowsRegistry; +import org.eclipse.core.runtime.Platform; import com.sun.jna.Native; import com.sun.jna.platform.win32.Advapi32; @@ -33,6 +34,8 @@ import com.sun.jna.ptr.IntByReference; */ public class WindowsRegistryImpl extends WindowsRegistry { + private final static boolean DEBUG = Platform.getDebugBoolean(CNativePlugin.PLUGIN_ID + "/debug/win32/registry"); //$NON-NLS-1$ + @Override public String getLocalMachineValue(String subkey, String name) { return getValue(WinReg.HKEY_LOCAL_MACHINE, subkey, name); @@ -67,7 +70,9 @@ public class WindowsRegistryImpl extends WindowsRegistry { try { return Advapi32Util.registryGetStringValue(key, subkey, name); } catch (Win32Exception e) { - CNativePlugin.log(String.format("Unable to get value for %s in %s", name, subkey), e); //$NON-NLS-1$ + if (DEBUG) { + CNativePlugin.log(String.format("Unable to get value for %s in %s", name, subkey), e); //$NON-NLS-1$ + } return null; } } @@ -82,7 +87,9 @@ public class WindowsRegistryImpl extends WindowsRegistry { Advapi32Util.registryCloseKey(phkKey.getValue()); } } catch (Win32Exception e) { - CNativePlugin.log(String.format("Unable to get keyname for %s at index %d", subkey, index), e); //$NON-NLS-1$ + if (DEBUG) { + CNativePlugin.log(String.format("Unable to get keyname for %s at index %d", subkey, index), e); //$NON-NLS-1$ + } return null; } } @@ -105,7 +112,9 @@ public class WindowsRegistryImpl extends WindowsRegistry { Advapi32Util.registryCloseKey(phkKey.getValue()); } } catch (Win32Exception e) { - CNativePlugin.log(String.format("Unable to get valuename for %s at index %d", subkey, index), e); //$NON-NLS-1$ + if (DEBUG) { + CNativePlugin.log(String.format("Unable to get valuename for %s at index %d", subkey, index), e); //$NON-NLS-1$ + } return null; } }