aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java
index 89af32dac9..ccf32306ef 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java
@@ -33,11 +33,17 @@ public class ValgrindCommand {
public String whichVersion(IProject project) throws IOException {
StringBuffer out = new StringBuffer();
+ String version = "";
Process p = RuntimeProcessFactory.getFactory().exec(new String[] { VALGRIND_CMD, CommandLineConstants.OPT_VERSION }, project);
- readIntoBuffer(out, p);
- return out.toString().trim();
+ try {
+ readIntoBuffer(out, p);
+ version = out.toString().trim();
+ } catch(IOException e) {
+ e.printStackTrace();
+ }
+ return version;
}
-
+
public void execute(String[] commandArray, Object env, File wd, String exeFile, boolean usePty, IProject project) throws IOException {
args = commandArray;
try {
@@ -78,6 +84,9 @@ public class ValgrindCommand {
protected void readIntoBuffer(StringBuffer out, Process p) throws IOException {
boolean success;
InputStream in, err, input;
+ if (p == null ) {
+ throw new IOException("Null Process object: unabled to read input into buffer");
+ }
try {
//We need to get the inputs before calling waitFor
input = p.getInputStream();