From 061ab96a35256cb9077e1ae3c036e99d99698062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Thu, 24 Apr 2025 10:19:01 +0200 Subject: [PATCH 1/2] Remove Windows 98 Fallback from spawner Currently there is a specific branch to "fallback" for Windows 98, this does not seem to have any relevance today. --- core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF | 2 +- core/org.eclipse.cdt.core.native/pom.xml | 2 +- .../org/eclipse/cdt/utils/spawner/ProcessFactory.java | 11 ++--------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF index 7ced14ba6c4..4d275d04ac2 100644 --- a/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF +++ b/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.core.native;singleton:=true -Bundle-Version: 6.5.0.qualifier +Bundle-Version: 6.6.0.qualifier Bundle-Activator: org.eclipse.cdt.internal.core.natives.CNativePlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/core/org.eclipse.cdt.core.native/pom.xml b/core/org.eclipse.cdt.core.native/pom.xml index 072c93eff6d..7449e3c13be 100644 --- a/core/org.eclipse.cdt.core.native/pom.xml +++ b/core/org.eclipse.cdt.core.native/pom.xml @@ -23,7 +23,7 @@ ../../pom.xml - 6.5.0-SNAPSHOT + 6.6.0-SNAPSHOT org.eclipse.cdt.core.native eclipse-plugin diff --git a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java index addd040267a..59c86349ad0 100644 --- a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java +++ b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java @@ -285,17 +285,10 @@ public Process start() throws IOException { } private ProcessFactory() { - hasSpawner = false; - String OS = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$ runtime = Runtime.getRuntime(); try { - // Spawner does not work for Windows 98 fallback - if (OS != null && OS.equals("windows 98")) { //$NON-NLS-1$ - hasSpawner = false; - } else { - System.loadLibrary("spawner"); //$NON-NLS-1$ - hasSpawner = true; - } + System.loadLibrary("spawner"); //$NON-NLS-1$ + hasSpawner = true; } catch (SecurityException e) { e.printStackTrace(); } catch (UnsatisfiedLinkError e) { From 8b22be8683776e3e8d68c322b727e5997692c980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Thu, 24 Apr 2025 10:19:01 +0200 Subject: [PATCH 2/2] Allow debugging without modify the source Currently one needs to modify and recompile the source to enable debugging, this is replaced by a system property that can be set. --- .../src/org/eclipse/cdt/utils/spawner/ProcessFactory.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java index 59c86349ad0..ace68a99271 100644 --- a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java +++ b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/spawner/ProcessFactory.java @@ -36,6 +36,8 @@ */ public class ProcessFactory { + private static final boolean DEBUG = Boolean.getBoolean("org.eclipse.cdt.utils.spawner.debug"); //$NON-NLS-1$ + static private ProcessFactory instance; private boolean hasSpawner; private Runtime runtime; @@ -255,9 +257,9 @@ private StringBuilder debug() { } public Process start() throws IOException { - // Uncomment the next line, set a breakpoint in the last line of debug() method, - // when the breakpoint is triggered, inspect the sb variable to see detailed info on what is being launched. - // debug(); + if (DEBUG) { + debug(); + } Process p; if (hasSpawner) { if (use_pty) {