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

Bug 542488: Convert URL to path properly on Windows

Change-Id: I63a5c3e260583b4df82e4c5bf8fbbdf3e5958e54
This commit is contained in:
Jonah Graham 2019-08-12 17:10:38 -04:00
parent a3938937f2
commit 15b00032ce

View file

@ -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(() -> {