Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2019-08-12 21:10:38 +0000
committerJonah Graham2019-08-12 22:30:57 +0000
commit15b00032cea865801ba203c471742e41b20f9bfe (patch)
tree74558878824217c346b69bef5c4f85c0298dedff
parenta3938937f2cd4966dc216c45f8114da4baab02b8 (diff)
downloadorg.eclipse.cdt-15b00032cea865801ba203c471742e41b20f9bfe.tar.gz
org.eclipse.cdt-15b00032cea865801ba203c471742e41b20f9bfe.tar.xz
org.eclipse.cdt-15b00032cea865801ba203c471742e41b20f9bfe.zip
Bug 542488: Convert URL to path properly on Windows
-rw-r--r--debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapLaunchDelegate.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapLaunchDelegate.java b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapLaunchDelegate.java
index 05659f29119..19eff8a437b 100644
--- a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapLaunchDelegate.java
+++ b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/DapLaunchDelegate.java
@@ -10,8 +10,10 @@
*******************************************************************************/
package org.eclipse.cdt.debug.dap;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URISyntaxException;
import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
@@ -89,7 +91,7 @@ public class DapLaunchDelegate extends AbstractCLaunchDelegate2 {
throw new IOException(
Messages.DapLaunchDelegate_missing_debugAdapter_script + Activator.PLUGIN_ID + debugAdapterJs);
}
- String path = fileURL.getPath();
+ String path = new File(fileURL.toURI()).toString();
List<String> debugCmdArgs = Collections.singletonList(path);
DSPLaunchDelegateLaunchBuilder builder = new DSPLaunchDelegateLaunchBuilder(configuration, mode, launch,
@@ -111,7 +113,7 @@ public class DapLaunchDelegate extends AbstractCLaunchDelegate2 {
}
};
dspLaunchDelegate.launch(builder);
- } catch (IOException e) {
+ } catch (IOException | URISyntaxException e) {
IStatus errorStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
Activator.getDefault().getLog().log(errorStatus);
Display.getDefault().asyncExec(() -> {

Back to the top