Re: Not seeing target output in GDB/MI

Daniel Jacobowitz
2004-12-10T13:38:19Z

On Fri, Dec 10, 2004 at 11:11:20AM +0100, Johannes Overmann wrote:
> I can factor out two simple questions:
>
> - Is there a way to see the target output (stdout) unbuffered or line
> buffered
> and still using pipes to comminucate with gdb?
>
> - Why is the target output not visible in the target-stream-output
> described in the
> MI documentation (e.g. prefixed by @)? I see it just as any other output
> coming from gdb without any indication that it comes from the target.

They have the same answer: GDB does not support encapsulated output for
native targets. What's probably happening is that the inferior is
writing to the same pipe that you used to communicate with GDB, and
your C library is defaulting to block buffering when it detects that
stdout is not a TTY.

Some remote targets offer output encapsulation. It wouldn't be
terribly hard to implement for native, but it isn't terribly useful
either, so no one has done the work. Easiest thing to do may be to use
the "tty" command in GDB. I don't know if there's a matching MI
command.

--
Daniel Jacobowitz