Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java')
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.core/src/org/eclipse/linuxtools/internal/valgrind/core/ValgrindCommand.java26
1 files changed, 14 insertions, 12 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 c7557306e8..d2563e6c70 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
@@ -49,20 +49,10 @@ public class ValgrindCommand {
return out.toString().trim();
}
- public void execute(String[] commandArray, String[] env, File wd, boolean usePty) throws IOException {
+ public void execute(String[] commandArray, Object env, File wd, String exeFile, boolean usePty) throws IOException {
args = commandArray;
try {
- if (wd == null) {
- process = ProcessFactory.getFactory().exec(commandArray, env);
- }
- else {
- if (PTY.isSupported() && usePty) {
- process = ProcessFactory.getFactory().exec(commandArray, env, wd, new PTY());
- }
- else {
- process = ProcessFactory.getFactory().exec(commandArray, env, wd);
- }
- }
+ process = startProcess(commandArray, env, wd, exeFile, usePty);
}
catch (IOException e) {
if (process != null) {
@@ -83,6 +73,18 @@ public class ValgrindCommand {
}
return ret.toString().trim();
}
+
+ protected Process startProcess(String[] commandArray, Object env, File workDir, String binPath, boolean usePty) throws IOException {
+ if (workDir == null) {
+ return ProcessFactory.getFactory().exec(commandArray, (String[]) env);
+ }
+ if (PTY.isSupported() && usePty) {
+ return ProcessFactory.getFactory().exec(commandArray, (String[]) env, workDir, new PTY());
+ }
+ else {
+ return ProcessFactory.getFactory().exec(commandArray, (String[]) env, workDir);
+ }
+ }
protected void readIntoBuffer(StringBuffer out, Process p) throws IOException {
boolean success;

Back to the top