Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--profiling/org.eclipse.linuxtools.profiling-feature/feature.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling-feature/pom.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/pom.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java87
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java23
6 files changed, 76 insertions, 42 deletions
diff --git a/profiling/org.eclipse.linuxtools.profiling-feature/feature.xml b/profiling/org.eclipse.linuxtools.profiling-feature/feature.xml
index 44243fd8ba..e91ebd0a19 100644
--- a/profiling/org.eclipse.linuxtools.profiling-feature/feature.xml
+++ b/profiling/org.eclipse.linuxtools.profiling-feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.linuxtools.profiling"
label="%featureName"
- version="2.0.0.qualifier"
+ version="2.2.0.qualifier"
provider-name="%featureProvider"
license-feature="org.eclipse.linuxtools.license.feature"
license-feature-version="1.0.0.qualifier">
diff --git a/profiling/org.eclipse.linuxtools.profiling-feature/pom.xml b/profiling/org.eclipse.linuxtools.profiling-feature/pom.xml
index 420a3cfa8c..edd1673415 100644
--- a/profiling/org.eclipse.linuxtools.profiling-feature/pom.xml
+++ b/profiling/org.eclipse.linuxtools.profiling-feature/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.profiling</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<name>Linux Tools Profiling Framework Feature</name>
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF b/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF
index 69a18079ab..474f69039d 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.eclipse.linuxtools.profiling.launch;singleton:=true
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 2.2.0.qualifier
Bundle-Activator: org.eclipse.linuxtools.internal.profiling.launch.ProfileLaunchPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml b/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml
index f487ca53c8..faed214451 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.profiling.launch</artifactId>
- <version>2.1.0-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Linux Tools Profiling Launch Plug-in</name>
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java
index 35d6841703..86d0dc94e1 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyCMainTab.java
@@ -142,12 +142,12 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
setControl(comp);
ProfileLaunchPlugin
- .getDefault()
- .getWorkbench()
- .getHelpSystem()
- .setHelp(
- getControl(),
- ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB);
+ .getDefault()
+ .getWorkbench()
+ .getHelpSystem()
+ .setHelp(
+ getControl(),
+ ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB);
GridLayout topLayout = new GridLayout();
comp.setLayout(topLayout);
@@ -301,10 +301,10 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
protected void handleSearchButtonSelected() {
if (getCProject() == null) {
MessageDialog
- .openInformation(
- getShell(),
- LaunchMessages.CMainTab_Project_required,
- LaunchMessages.CMainTab_Enter_project_before_searching_for_program);
+ .openInformation(
+ getShell(),
+ LaunchMessages.CMainTab_Project_required,
+ LaunchMessages.CMainTab_Enter_project_before_searching_for_program);
return;
}
@@ -531,24 +531,25 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
protected void updateWorkingDirFromConfig(ILaunchConfiguration config) {
if (workingDirText != null) {
- String workingDir = EMPTY_STRING;
+ String projectDir = EMPTY_STRING;
try {
- workingDir = config.getAttribute(ATTR_REMOTE_WORKING_DIRECTORY_NAME, EMPTY_STRING);
+ projectDir = config.getAttribute(ATTR_REMOTE_WORKING_DIRECTORY_NAME, EMPTY_STRING);
} catch (CoreException ce) {
ProfileLaunchPlugin.log(ce);
}
- if (workingDir.equals(EMPTY_STRING)){
- if(this.fProjText != null){
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IProject project = root.getProject(this.fProjText.getText());
- if(project != null){
- workingDir = project.getLocationURI().toString();
- }
+ if (projectDir.equals(EMPTY_STRING)){
+ if(this.fProjText != null){
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IProject project = root.getProject(this.fProjText.getText());
+ try {
+ projectDir = RemoteProxyManager.getInstance().getRemoteProjectLocation(project);
+ } catch (CoreException e) {
+ setErrorMessage(fPreviouslyCheckedWorkingDirErrorMsg = ProxyLaunchMessages.error_accessing_working_directory);
}
+ }
}
-
- workingDirText.setText(workingDir);
+ workingDirText.setText(projectDir);
}
}
@@ -595,9 +596,9 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
}
fPreviouslyCheckedCopyFromExe = name;
fPreviouslyCheckedCopyFromExeIsValid = true; // we'll flip this below if
- // not true
+ // not true
fPreviouslyCheckedCopyFromExeErrorMsg = null; // we'll set this below if
- // there's an error
+ // there's an error
IPath exePath;
URI exeURI = null;
boolean passed = false;
@@ -615,7 +616,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
URI projectURI = project.getLocationURI();
exeURI = new URI(projectURI.getScheme(),
projectURI.getAuthority(), projectURI.getRawPath() + '/'
- + exePath.toString(), EMPTY_STRING);
+ + exePath.toString(), EMPTY_STRING);
}
if (exeURI != null) {
passed = true;
@@ -645,7 +646,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
if (exeFI != null) {
if (exeFI.exists()) {
if (exeFI.getAttribute(EFS.ATTRIBUTE_EXECUTABLE) &&
- !exeFI.isDirectory()) {
+ !exeFI.isDirectory()) {
passed = true;
} else {
setErrorMessage(fPreviouslyCheckedCopyFromExeErrorMsg = ProxyLaunchMessages.copy_from_exe_does_not_have_execution_rights);
@@ -690,9 +691,9 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
}
fPreviouslyCheckedProgram = name;
fPreviouslyCheckedProgramIsValid = true; // we'll flip this below if
- // not true
+ // not true
fPreviouslyCheckedProgramErrorMsg = null; // we'll set this below if
- // there's an error
+ // there's an error
IPath exePath;
URI exeURI = null;
boolean passed = false;
@@ -711,7 +712,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
URI projectURI = project.getLocationURI();
exeURI = new URI(projectURI.getScheme(),
projectURI.getAuthority(), projectURI.getRawPath() + '/'
- + exePath.toString(), EMPTY_STRING);
+ + exePath.toString(), EMPTY_STRING);
}
if (exeURI != null) {
passed = true;
@@ -745,7 +746,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
} else {
if (exeFI.exists()) {
if (exeFI.getAttribute(EFS.ATTRIBUTE_EXECUTABLE) &&
- !exeFI.isDirectory()) {
+ !exeFI.isDirectory()) {
passed = true;
} else {
setErrorMessage(fPreviouslyCheckedProgramErrorMsg = ProxyLaunchMessages.executable_does_not_have_execution_rights);
@@ -789,9 +790,9 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
}
fPreviouslyCheckedWorkingDir = name;
fPreviouslyCheckedWorkingDirIsValid = true; // we'll flip this below if
- // not true
+ // not true
fPreviouslyCheckedWorkingDirErrorMsg = null; // we'll set this below if
- // there's an error
+ // there's an error
IPath wdPath;
URI wdURI = null;
boolean passed = false;
@@ -810,7 +811,7 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
URI projectURI = project.getLocationURI();
wdURI = new URI(projectURI.getScheme(),
projectURI.getAuthority(), projectURI.getRawPath() + '/'
- + wdPath.toString(), EMPTY_STRING);
+ + wdPath.toString(), EMPTY_STRING);
}
if (wdURI != null) {
passed = true;
@@ -1092,11 +1093,25 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
binary = (IBinary) cElement;
}
+ String projectDir = EMPTY_STRING;
+ ConfigUtils configUtils = new ConfigUtils(config);
+ IProject project = null;
+ try {
+ project = ConfigUtils.getProject(configUtils.getProjectName());
+ } catch (CoreException e) {
+ setErrorMessage(fPreviouslyCheckedWorkingDirErrorMsg = ProxyLaunchMessages.error_accessing_working_directory);
+ }
+ if(project != null){
+ try {
+ projectDir = RemoteProxyManager.getInstance().getRemoteProjectLocation(project);
+ } catch (CoreException e) {
+ setErrorMessage(fPreviouslyCheckedWorkingDirErrorMsg = ProxyLaunchMessages.error_accessing_working_directory);
+ }
+ }
+
+ String path = EMPTY_STRING;
if (binary != null) {
- String path;
path = binary.getResource().getProjectRelativePath().toOSString();
- config.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, path);
if (!renamed) {
String name = binary.getElementName();
int index = name.lastIndexOf('.');
@@ -1108,6 +1123,8 @@ public class RemoteProxyCMainTab extends CAbstractMainTab {
renamed = true;
}
}
+ config.setAttribute(
+ ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, projectDir + IPath.SEPARATOR + path);
if (!renamed) {
String name = getLaunchConfigurationDialog().generateName(
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
index 13f108df35..09ce4f76c4 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
@@ -94,7 +94,7 @@ public class RemoteProxyManager implements IRemoteProxyManager {
return manager.getFileProxy(uri);
else
throw new CoreException(new Status(IStatus.ERROR, ProfileLaunchPlugin.PLUGIN_ID,
- IStatus.OK, Messages.RemoteProxyManager_unrecognized_scheme + scheme, null));
+ IStatus.OK, Messages.RemoteProxyManager_unrecognized_scheme + scheme, null));
}
return getLocalFileProxy(uri);
}
@@ -120,7 +120,7 @@ public class RemoteProxyManager implements IRemoteProxyManager {
if (scheme != null && !scheme.equals(LOCALSCHEME)){
IRemoteProxyManager manager = getRemoteManager(scheme);
if (manager != null)
- return manager.getLauncher(uri);
+ return manager.getLauncher(uri);
}
return new LocalLauncher();
}
@@ -145,7 +145,7 @@ public class RemoteProxyManager implements IRemoteProxyManager {
if (scheme != null && !scheme.equals(LOCALSCHEME)){
IRemoteProxyManager manager = getRemoteManager(scheme);
if (manager != null)
- return manager.getOS(uri);
+ return manager.getOS(uri);
}
return Platform.getOS();
}
@@ -161,5 +161,22 @@ public class RemoteProxyManager implements IRemoteProxyManager {
return getOS(projectURI);
}
+ /**
+ * This method gets the proper remote project location
+ * of pure remote and sync projects. Synchronized projects
+ * have a cached path and a remote one, and this method
+ * returns the remote one.
+ * @return string containing the project location
+ * @since 2.2
+ */
+ public String getRemoteProjectLocation(IProject project) throws CoreException {
+ if(project != null){
+ IRemoteFileProxy remoteFileProxy = null;
+ remoteFileProxy = getFileProxy(project);
+ URI workingDirURI = remoteFileProxy.getWorkingDir();
+ return workingDirURI.toString();
+ }
+ return null;
+ }
}

Back to the top