Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-debug-dev] MI: obtaining GDB's stderr

Hi,

How can I get access to GDB's stderr? I am trying to obtain additional (error) information that is returned from a "monitor" command.

I am using the following code but reader.ready() always returns false.

MIProcess gdbProcess = miSession.getGDBProcess();
InputStream err = gdbProcess.getErrorStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(
		err));
String line = null;
try {
	while (reader.ready()) {
		line = reader.readLine();
		errors.add(line) ;
	}
	reader.close();
} catch (Exception e) {
	e.printStackTrace() ;// the reader may throw a NPE.
}

I know that data is being written to stderr - I just can't get it!

TIA
--
Derek


Back to the top