diff options
author | Alain Magloire | 2003-04-07 13:54:57 +0000 |
---|---|---|
committer | Alain Magloire | 2003-04-07 13:54:57 +0000 |
commit | 6c1f5516d6afc529d1246520d119543e1bd3f285 (patch) | |
tree | 3a8c82a2e637f679714d2f80b4b029270e838bd5 | |
parent | 9e690a9e38a3c8b1cbbfcfc3f970c2c52cd30be7 (diff) | |
download | org.eclipse.cdt-6c1f5516d6afc529d1246520d119543e1bd3f285.tar.gz org.eclipse.cdt-6c1f5516d6afc529d1246520d119543e1bd3f285.tar.xz org.eclipse.cdt-6c1f5516d6afc529d1246520d119543e1bd3f285.zip |
Check for program == null when creating the session.
-rw-r--r-- | debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java index 6ec24b90fd7..eaff877a27a 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/MIPlugin.java @@ -106,9 +106,17 @@ public class MIPlugin extends Plugin { String[] args; if (pty != null) { - args = new String[] {gdb, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1", program}; + if (program == null) { + args = new String[] {gdb, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1"}; + } else { + args = new String[] {gdb, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1", program}; + } } else { - args = new String[] {gdb, "-q", "-nw", "-i", "mi1", program}; + if (program == null) { + args = new String[] {gdb, "-q", "-nw", "-i", "mi1"}; + } else { + args = new String[] {gdb, "-q", "-nw", "-i", "mi1", program}; + } } Process pgdb = ProcessFactory.getFactory().exec(args); @@ -141,7 +149,12 @@ public class MIPlugin extends Plugin { if (gdb == null || gdb.length() == 0) { gdb = "gdb"; } - String[] args = new String[] {gdb, "--quiet", "-nw", "-i", "mi1", program, core}; + String[] args; + if (program == null) { + args = new String[] {gdb, "--quiet", "-nw", "-i", "mi1", "-c", core}; + } else { + args = new String[] {gdb, "--quiet", "-nw", "-i", "mi1", "-c", core, program}; + } Process pgdb = ProcessFactory.getFactory().exec(args); MISession session = createMISession(pgdb, null, MISession.CORE); return new CSession(session); @@ -158,7 +171,15 @@ public class MIPlugin extends Plugin { if (gdb == null || gdb.length() == 0) { gdb = "gdb"; } - String[] args = new String[] {gdb, "--quiet", "-nw", "-i", "mi1", program}; + + String[] args = null; + + if (program == null) { + args = new String[] {gdb, "--quiet", "-nw", "-i", "mi1"}; + } else { + args = new String[] {gdb, "--quiet", "-nw", "-i", "mi1", program}; + } + Process pgdb = ProcessFactory.getFactory().exec(args); MISession session = createMISession(pgdb, null, MISession.ATTACH); MIInfo info = null; |