Skip to main content

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

Hi Derek,

In most cases the process returned by "getGDBProcess" is not a process
that runs gdb. There is a class called Spawner that starts a gdb process
and creates the pipes for stdin, stdout and stderr. The Spawner's native
code is located in the "library" directory of the
org.eclipse.cdt.core.<os> plugins. It may be a bug, I don't know if we
have ever used the error stream from gdb.

It would be very useful if you and other "monitor" users come up with
the requirements on how to improve the support for "monitor" in general.
My personal experience with it is very limited.

Regards,
Mikhail

-----Original Message-----
From: cdt-debug-dev-bounces@xxxxxxxxxxx
[mailto:cdt-debug-dev-bounces@xxxxxxxxxxx] On Behalf Of Derek Morris
Sent: 13 November 2006 16:59
To: CDT Debug developers list
Subject: [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
_______________________________________________
cdt-debug-dev mailing list
cdt-debug-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-debug-dev

-- 
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.




Back to the top