Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2015-07-27 04:58:39 -0400
committerAnton Leherbauer2015-07-27 04:58:50 -0400
commitb43bd4a9fc874dfe30eb8a9de70940a2cc6d8ed1 (patch)
tree9474346e270a127d657bdd0c49ef6c37886ed095
parent47ee329cdeed257207d6825bef2c0cfc523c22d4 (diff)
downloadorg.eclipse.tcf-b43bd4a9fc874dfe30eb8a9de70940a2cc6d8ed1.tar.gz
org.eclipse.tcf-b43bd4a9fc874dfe30eb8a9de70940a2cc6d8ed1.tar.xz
org.eclipse.tcf-b43bd4a9fc874dfe30eb8a9de70940a2cc6d8ed1.zip
Target Explorer: Add support for project-less run launch
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TERunLaunchDelegate.java28
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/utils/TEHelper.java2
2 files changed, 23 insertions, 7 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TERunLaunchDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TERunLaunchDelegate.java
index c20452257..55f392c91 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TERunLaunchDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/launching/TERunLaunchDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013 - 2015 MontaVista Software, LLC. and others. All rights reserved.
+ * Copyright (c) 2013, 2015 MontaVista Software, LLC. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@@ -10,13 +10,15 @@
package org.eclipse.tcf.te.tcf.launch.cdt.launching;
import java.io.IOException;
+import java.text.DateFormat;
+import java.text.MessageFormat;
+import java.util.Date;
import java.util.Map;
import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils;
-import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
+import org.eclipse.cdt.launch.AbstractCLaunchDelegate2;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -33,7 +35,11 @@ import org.eclipse.tcf.te.tcf.launch.cdt.nls.Messages;
import org.eclipse.tcf.te.tcf.launch.cdt.utils.TEHelper;
import org.eclipse.tcf.te.tcf.launch.cdt.utils.TERunProcess;
-public class TERunLaunchDelegate extends AbstractCLaunchDelegate {
+public class TERunLaunchDelegate extends AbstractCLaunchDelegate2 {
+
+ public TERunLaunchDelegate() {
+ super(false);
+ }
@SuppressWarnings("unused")
@Override
@@ -70,7 +76,7 @@ public class TERunLaunchDelegate extends AbstractCLaunchDelegate {
protected IPath checkBinaryDetails(final ILaunchConfiguration config) throws CoreException {
// First verify we are dealing with a proper project.
- ICProject project = CDebugUtils.verifyCProject(config);
+ ICProject project = verifyCProject(config);
// Now verify we know the program to debug.
IPath exePath = LaunchUtils.verifyProgramPath(config, project);
// Finally, make sure the program is a proper binary.
@@ -78,8 +84,18 @@ public class TERunLaunchDelegate extends AbstractCLaunchDelegate {
return exePath;
}
+ protected String getProgramArguments(ILaunchConfiguration config) throws CoreException {
+ return org.eclipse.cdt.launch.LaunchUtils.getProgramArguments(config);
+ }
+
+ protected String renderProcessLabel(String commandLine) {
+ String format = "{0} ({1})"; //$NON-NLS-1$
+ String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis()));
+ return MessageFormat.format(format, new Object[]{commandLine, timestamp});
+ }
+
/* (non-Javadoc)
- * @see org.eclipse.cdt.launch.AbstractCLaunchDelegate#getPluginID()
+ * @see org.eclipse.cdt.launch.AbstractCLaunchDelegate2#getPluginID()
*/
@Override
protected String getPluginID() {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/utils/TEHelper.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/utils/TEHelper.java
index 44e413155..126054e44 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/utils/TEHelper.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.cdt/src/org/eclipse/tcf/te/tcf/launch/cdt/utils/TEHelper.java
@@ -194,7 +194,7 @@ public class TEHelper {
}
public static ProcessLauncher launchCmdWithEnv(final IPeer peer, String peerName, String remoteCommandPath, String arguments, Map<String, String> env, Listener listener, SubProgressMonitor monitor, ICallback callback) throws CoreException {
- String[] args = arguments != null && !"".equals(arguments.trim()) ? StringUtil.tokenize(arguments, 0, true) : null; //$NON-NLS-1$
+ String[] args = arguments != null && !"".equals(arguments.trim()) ? StringUtil.tokenize(arguments, 0, false) : null; //$NON-NLS-1$
return launchCmdWithEnv(peer, peerName, remoteCommandPath, args, env, listener, monitor, callback);
}

Back to the top