1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

move the creation of pty into a higher another method.

This commit is contained in:
Alain Magloire 2002-10-09 13:38:21 +00:00
parent f5456b1ad1
commit 426a675867

View file

@ -78,19 +78,30 @@ public class MIPlugin extends Plugin {
* @throws MIException
*/
public ICDISession createCSession(String gdb, String program) throws IOException, MIException {
PTY pty = null;
try {
pty = new PTY();
String ttyName = pty.getSlaveName();
} catch (IOException e) {
}
return createCSession(gdb, program, pty);
}
/**
* Method createCSession.
* @param program
* @return ICDISession
* @throws IOException
*/
public ICDISession createCSession(String gdb, String program, PTY pty) throws IOException, MIException {
if (gdb == null || gdb.length() == 0) {
gdb = "gdb";
}
String[] args;
PTY pty = null;
try {
pty = new PTY();
String ttyName = pty.getSlaveName();
args = new String[] {gdb, "-q", "-nw", "-tty", ttyName, "-i", "mi1", program};
} catch (IOException e) {
//e.printStackTrace();
pty = null;
if (pty != null) {
args = new String[] {gdb, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1", program};
} else {
args = new String[] {"gdb", "-q", "-nw", "-i", "mi1", program};
}