mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 12:25:35 +02:00
new method getSessionProcess() and rename getMIProcess()
getGDBProcess().
This commit is contained in:
parent
1e55ad4fb2
commit
98af1928a2
1 changed files with 20 additions and 7 deletions
|
@ -52,7 +52,8 @@ public class MISession extends Observable {
|
||||||
// hold the type of the session(post-mortem, attach etc ..)
|
// hold the type of the session(post-mortem, attach etc ..)
|
||||||
int sessionType;
|
int sessionType;
|
||||||
|
|
||||||
Process miProcess;
|
Process sessionProcess;
|
||||||
|
Process gdbProcess;
|
||||||
InputStream inChannel;
|
InputStream inChannel;
|
||||||
OutputStream outChannel;
|
OutputStream outChannel;
|
||||||
|
|
||||||
|
@ -79,6 +80,7 @@ public class MISession extends Observable {
|
||||||
MIInferior inferior;
|
MIInferior inferior;
|
||||||
|
|
||||||
int cmdCount = 1;
|
int cmdCount = 1;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the gdb session.
|
* Create the gdb session.
|
||||||
|
@ -90,7 +92,7 @@ public class MISession extends Observable {
|
||||||
*/
|
*/
|
||||||
public MISession(Process process, PTY pty, int timeout, int type) throws MIException {
|
public MISession(Process process, PTY pty, int timeout, int type) throws MIException {
|
||||||
|
|
||||||
miProcess = process;
|
gdbProcess = process;
|
||||||
inChannel = process.getInputStream();
|
inChannel = process.getInputStream();
|
||||||
outChannel = process.getOutputStream();
|
outChannel = process.getOutputStream();
|
||||||
|
|
||||||
|
@ -295,10 +297,21 @@ public class MISession extends Observable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the "gdb/mi" Process.
|
* Return the "gdb" Process.
|
||||||
*/
|
*/
|
||||||
public Process getMIProcess() {
|
public Process getGDBProcess() {
|
||||||
return miProcess;
|
return gdbProcess;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a "fake" Process that will
|
||||||
|
* encapsulate the call input/output of gdb.
|
||||||
|
*/
|
||||||
|
public Process getSessionProcess() {
|
||||||
|
if (sessionProcess == null) {
|
||||||
|
sessionProcess = new SessionProcess(this);
|
||||||
|
}
|
||||||
|
return sessionProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -346,8 +359,8 @@ public class MISession extends Observable {
|
||||||
// Make sure gdb is killed.
|
// Make sure gdb is killed.
|
||||||
// FIX: the destroy() must be call before closing gdb streams
|
// FIX: the destroy() must be call before closing gdb streams
|
||||||
// on windows if the order is not follow the close() will hang.
|
// on windows if the order is not follow the close() will hang.
|
||||||
if (miProcess != null) {
|
if (gdbProcess != null) {
|
||||||
miProcess.destroy();
|
gdbProcess.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close the input GDB prompt
|
// Close the input GDB prompt
|
||||||
|
|
Loading…
Add table
Reference in a new issue