Skip to main content
summaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
authorJohn Cortell2008-08-26 23:17:04 +0000
committerJohn Cortell2008-08-26 23:17:04 +0000
commite123e11d87b3c6469cd972846bb44fe73d27ba94 (patch)
treea45c82a443b983c53d33bb347ea8c0d19e7e0e8f /launch
parent54d0aeb51f6ade5558312f18c5cc09613bc91fd1 (diff)
downloadorg.eclipse.cdt-e123e11d87b3c6469cd972846bb44fe73d27ba94.tar.gz
org.eclipse.cdt-e123e11d87b3c6469cd972846bb44fe73d27ba94.tar.xz
org.eclipse.cdt-e123e11d87b3c6469cd972846bb44fe73d27ba94.zip
Restore support for a program specification that is a linked resource
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java11
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java16
2 files changed, 27 insertions, 0 deletions
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
index 9982a73fc98..620d7a0a926 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
@@ -377,6 +377,17 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
IPath location = cproject.getProject().getLocation();
if (location != null) {
programPath = location.append(programPath);
+ if (!programPath.toFile().exists()) {
+ // Try the old way, which is required to support linked resources.
+ IFile projFile = null;
+ try {
+ projFile = project.getFile(getProgramPath(config));
+ }
+ catch (IllegalArgumentException exc) {} // thrown if relative path that resolves to a root file (e.g., "..\somefile")
+ if (projFile != null && projFile.exists()) {
+ programPath = projFile.getLocation();
+ }
+ }
}
}
if (!programPath.toFile().exists()) {
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
index 8904c1f058e..fb3cf43ddc3 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
@@ -33,6 +33,7 @@ import org.eclipse.cdt.launch.internal.ui.LaunchMessages;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
import org.eclipse.cdt.ui.CElementLabelProvider;
import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -558,6 +559,21 @@ public class CMainTab extends CLaunchConfigurationTab {
}
exePath = location.append(name);
+ if (!exePath.toFile().exists()) {
+ // Try the old way, which is required to support linked resources.
+ IFile projFile = null;
+ try {
+ projFile = project.getFile(name);
+ }
+ catch (IllegalArgumentException exc) {} // thrown if relative path that resolves to a root file ("..\somefile")
+ if (projFile == null || !projFile.exists()) {
+ setErrorMessage(LaunchMessages.getString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$
+ return false;
+ }
+ else {
+ exePath = projFile.getLocation();
+ }
+ }
}
if (!exePath.toFile().exists()) {
setErrorMessage(LaunchMessages.getString("CMainTab.Program_does_not_exist")); //$NON-NLS-1$

Back to the top