summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRodrigo Fraxino Araujo2012-06-27 10:19:00 (EDT)
committer Otavio Pontes2012-06-28 16:22:38 (EDT)
commitcaa8711868f24ae8ce46deebae32cf1bfc6d474d (patch)
tree95f3f3f157647d8557a74b080f21adccf98b9ff8
parent2d0c56f56e038377e694988140a2c4cca556d35f (diff)
downloadorg.eclipse.linuxtools-caa8711868f24ae8ce46deebae32cf1bfc6d474d.zip
org.eclipse.linuxtools-caa8711868f24ae8ce46deebae32cf1bfc6d474d.tar.gz
org.eclipse.linuxtools-caa8711868f24ae8ce46deebae32cf1bfc6d474d.tar.bz2
Fixed parsing RSE output of RuntimeProcessFactory.
-rw-r--r--profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.java25
1 files changed, 23 insertions, 2 deletions
diff --git a/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.java b/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.java
index 890f2f0..2a289e0 100644
--- a/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.java
+++ b/profiling/org.eclipse.linuxtools.tools.launch.core/src/org/eclipse/linuxtools/tools/launch/core/factory/RuntimeProcessFactory.java
@@ -119,15 +119,36 @@ public class RuntimeProcessFactory extends LinuxtoolsProcessFactory {
Process pProxy = launcher.execute(whichPath, new String[]{command}, envp, null, new NullProgressMonitor());
if (pProxy != null){
BufferedReader error = new BufferedReader(new InputStreamReader(pProxy.getErrorStream()));
+ BufferedReader reader = new BufferedReader(new InputStreamReader(pProxy.getInputStream()));
if(error.readLine() != null){
throw new IOException(error.readLine());
}
- BufferedReader reader = new BufferedReader(new InputStreamReader(pProxy.getInputStream()));
+ error.close();
String readLine = reader.readLine();
- command = readLine;
+ ArrayList<String> lines = new ArrayList<String>();
+ while (readLine != null) {
+ lines.add(readLine);
+ readLine = reader.readLine();
+ }
+ reader.close();
+ if (project.getLocationURI()!=null) {
+ if(project.getLocationURI().toString().startsWith("rse:")) { //$NON-NLS-1$
+ // RSE output
+ command = lines.get(lines.size()-2);
+ } else {
+ // Remotetools output
+ command = lines.get(0);
+ }
+ } else {
+ // Local output
+ command = lines.get(0);
+ }
}
} catch (CoreException e) {
e.printStackTrace();
+ } catch (IndexOutOfBoundsException e) {
+ // Executable cannot be found in system path.
+ e.printStackTrace();
}
}
return command;