aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Medeiros Teixeira2012-06-28 13:26:23 (EDT)
committerDaniel Henrique Barboza2012-06-28 15:39:38 (EDT)
commit2d0c56f56e038377e694988140a2c4cca556d35f (patch)
treeaf79034049e6b1a5d7892772d264fadefea93ade
parentc709409447ecbd2104f4db9ba79338d1fe3e9cd2 (diff)
downloadorg.eclipse.linuxtools-2d0c56f56e038377e694988140a2c4cca556d35f.zip
org.eclipse.linuxtools-2d0c56f56e038377e694988140a2c4cca556d35f.tar.gz
org.eclipse.linuxtools-2d0c56f56e038377e694988140a2c4cca556d35f.tar.bz2
Fixing bug with remote profiling when remote tools' connection name has whitespace characters
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java11
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindRemoteProxyLaunchDelegate.java19
2 files changed, 21 insertions, 9 deletions
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 9519bda..7f5b328 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
@@ -29,7 +29,7 @@ import org.eclipse.linuxtools.internal.profiling.launch.ProfileLaunchPlugin;
public class RemoteProxyManager implements IRemoteProxyManager {
private static final String EXT_ATTR_CLASS = "class"; //$NON-NLS-1$
- private static final String LocalHost = "LOCALHOST"; //$NON-NLS-1$
+ private static final String LOCALSCHEME = "file"; //$NON-NLS-1$
private static RemoteProxyManager manager;
private LocalFileProxy lfp;
@@ -75,8 +75,7 @@ public class RemoteProxyManager implements IRemoteProxyManager {
public IRemoteFileProxy getFileProxy(URI uri) throws CoreException {
String scheme = uri.getScheme();
- String host = uri.getHost();
- if (scheme != null && host != null && !LocalHost.equals(host)) {
+ if (scheme != null && !scheme.equals(LOCALSCHEME)){
IRemoteProxyManager manager = getRemoteManager(scheme);
if (manager != null)
return manager.getFileProxy(uri);
@@ -94,8 +93,7 @@ public class RemoteProxyManager implements IRemoteProxyManager {
public IRemoteCommandLauncher getLauncher(URI uri) throws CoreException {
String scheme = uri.getScheme();
- String host = uri.getHost();
- if (scheme != null && host != null && !LocalHost.equals(host)) {
+ if (scheme != null && !scheme.equals(LOCALSCHEME)){
IRemoteProxyManager manager = getRemoteManager(scheme);
if (manager != null)
return manager.getLauncher(uri);
@@ -110,8 +108,7 @@ public class RemoteProxyManager implements IRemoteProxyManager {
public String getOS(URI uri) throws CoreException {
String scheme = uri.getScheme();
- String host = uri.getHost();
- if (scheme != null && host != null && !LocalHost.equals(host)) {
+ if (scheme != null && !scheme.equals(LOCALSCHEME)){
IRemoteProxyManager manager = getRemoteManager(scheme);
if (manager != null)
return manager.getOS(uri);
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindRemoteProxyLaunchDelegate.java b/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindRemoteProxyLaunchDelegate.java
index a2fbd22..eaa4a0b 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindRemoteProxyLaunchDelegate.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.launch/src/org/eclipse/linuxtools/internal/valgrind/launch/ValgrindRemoteProxyLaunchDelegate.java
@@ -305,10 +305,25 @@ public class ValgrindRemoteProxyLaunchDelegate extends ValgrindLaunchConfigurati
String projectName = configUtils.getProjectName();
IProject project = ConfigUtils.getProject(projectName);
URI projectURI = project.getLocationURI();
- String Location = projectURI.getScheme() + "://" + projectURI.getHost();
+
+ String host = projectURI.getHost();
+
+ // Host might be null since it's not needed for a well-formed URI. Try authority instead
+ if(host == null){
+ host = projectURI.getAuthority();
+ }
+
+ // If authority is also null, use a generic name
+ String location;
+
+ if(host == null){
+ location = "remote host";
+ } else {
+ location = projectURI.getScheme() + "://" + host;
+ }
return config.getName()
- + " [" + valgrindPath.toString() + " " + getPlugin().getToolName(toolID) + " on " + Location + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ + " [" + valgrindPath.toString() + " " + getPlugin().getToolName(toolID) + " on " + location + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
@Override