public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Output from target in MI mode
@ 2005-11-18 12:34 Vladimir Prus
  2005-11-18 13:48 ` Bob Rossi
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Prus @ 2005-11-18 12:34 UTC (permalink / raw)
  To: gdb


Hi, 
the docs, in "MI Stream records", say:

 `"@" STRING-OUTPUT'
      The target output stream contains any textual output from the
      running target.

However, when I compile and run the following command:

  #include <stdio.h>

  int main()
  {
    printf("Hi\n");
    return 0;
  }

I see this:

   (gdb)
   -exec-run
   ^running
   (gdb)
   Hi
   *stopped,reason="exited-normally"
   (gdb)

The output from target is not prepended by "@". Gdb version is 6.3.
Is this a bug, or out-of-date docs, or I read the docs incorrectly?

- Volodya




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Output from target in MI mode
  2005-11-18 12:34 Output from target in MI mode Vladimir Prus
@ 2005-11-18 13:48 ` Bob Rossi
  2005-11-18 14:43   ` Vladimir Prus
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Rossi @ 2005-11-18 13:48 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb

On Fri, Nov 18, 2005 at 03:31:01PM +0300, Vladimir Prus wrote:
> 
> Hi, 
> the docs, in "MI Stream records", say:
> 
>  `"@" STRING-OUTPUT'
>       The target output stream contains any textual output from the
>       running target.
> 
> However, when I compile and run the following command:
> 
>   #include <stdio.h>
> 
>   int main()
>   {
>     printf("Hi\n");
>     return 0;
>   }
> 
> I see this:
> 
>    (gdb)
>    -exec-run
>    ^running
>    (gdb)
>    Hi
>    *stopped,reason="exited-normally"
>    (gdb)
> 
> The output from target is not prepended by "@". Gdb version is 6.3.
> Is this a bug, or out-of-date docs, or I read the docs incorrectly?

Currently, when running on the host, the output from the inferior is
mixed with the MI output. If you would like to separate the output you
can use the -inferior-set-tty command. This means that your front end
needs to be capable of creating a pty pair. That way, all of the
inferior output will be captured on a seperate descriptor.

The 'target' in teh above sentence I believe is refering to when GDB is
using a remote protocol to a specific piece of hardware. It's not
refering to the host.

Bob Rossi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Output from target in MI mode
  2005-11-18 13:48 ` Bob Rossi
@ 2005-11-18 14:43   ` Vladimir Prus
  2005-11-18 14:47     ` Bob Rossi
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Prus @ 2005-11-18 14:43 UTC (permalink / raw)
  To: gdb

On Friday 18 November 2005 16:48, Bob Rossi wrote:

> > I see this:
> >
> >    (gdb)
> >    -exec-run
> >    ^running
> >    (gdb)
> >    Hi
> >    *stopped,reason="exited-normally"
> >    (gdb)
> >
> > The output from target is not prepended by "@". Gdb version is 6.3.
> > Is this a bug, or out-of-date docs, or I read the docs incorrectly?
>
> Currently, when running on the host, the output from the inferior is
> mixed with the MI output. If you would like to separate the output you
> can use the -inferior-set-tty command. This means that your front end
> needs to be capable of creating a pty pair. That way, all of the
> inferior output will be captured on a seperate descriptor.

Sure, that's what happening now. But that pty handling is a bit messy, since 
gdb already knows what output comes from inferior, it could just prepend it 
with some character.

> The 'target' in teh above sentence I believe is refering to when GDB is
> using a remote protocol to a specific piece of hardware. It's not
> refering to the host.

Ok, then it's not clear to me either. There's specific packet in remote 
protocol ("OXXXX") which allows to pass arbitrary text from remote side to 
gdb. Is this what's printed with "@". Or there some other messages from 
remote that are also printed with "@" prefix?

- Volodya

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Output from target in MI mode
  2005-11-18 14:43   ` Vladimir Prus
@ 2005-11-18 14:47     ` Bob Rossi
  2005-11-18 15:31       ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Rossi @ 2005-11-18 14:47 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb

On Fri, Nov 18, 2005 at 05:43:46PM +0300, Vladimir Prus wrote:
> On Friday 18 November 2005 16:48, Bob Rossi wrote:
> 
> > > I see this:
> > >
> > >    (gdb)
> > >    -exec-run
> > >    ^running
> > >    (gdb)
> > >    Hi
> > >    *stopped,reason="exited-normally"
> > >    (gdb)
> > >
> > > The output from target is not prepended by "@". Gdb version is 6.3.
> > > Is this a bug, or out-of-date docs, or I read the docs incorrectly?
> >
> > Currently, when running on the host, the output from the inferior is
> > mixed with the MI output. If you would like to separate the output you
> > can use the -inferior-set-tty command. This means that your front end
> > needs to be capable of creating a pty pair. That way, all of the
> > inferior output will be captured on a seperate descriptor.
> 
> Sure, that's what happening now. But that pty handling is a bit messy, since 
> gdb already knows what output comes from inferior, it could just prepend it 
> with some character.

Actually, I don't think it does. GDB allows the inferior to run, and the
inferior's output get's directed directly to the terminal (I believe).

> > The 'target' in teh above sentence I believe is refering to when GDB is
> > using a remote protocol to a specific piece of hardware. It's not
> > refering to the host.
> 
> Ok, then it's not clear to me either. There's specific packet in remote 
> protocol ("OXXXX") which allows to pass arbitrary text from remote side to 
> gdb. Is this what's printed with "@". Or there some other messages from 
> remote that are also printed with "@" prefix?

I'm not sure. I've never seen output with the "@" before it. If you are
on the host, you will not get the "@" before the I/O from the inferior
process. Someone else might be able to give you more details on when
target I/O is done, if at all.

Bob Rossi

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Output from target in MI mode
  2005-11-18 14:47     ` Bob Rossi
@ 2005-11-18 15:31       ` Daniel Jacobowitz
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2005-11-18 15:31 UTC (permalink / raw)
  To: Vladimir Prus, gdb

On Fri, Nov 18, 2005 at 09:47:15AM -0500, Bob Rossi wrote:
> On Fri, Nov 18, 2005 at 05:43:46PM +0300, Vladimir Prus wrote:
> > Sure, that's what happening now. But that pty handling is a bit messy, since 
> > gdb already knows what output comes from inferior, it could just prepend it 
> > with some character.
> 
> Actually, I don't think it does. GDB allows the inferior to run, and the
> inferior's output get's directed directly to the terminal (I believe).

That is correct.  If GDB easily knew which was which, it would already
be using the MI-formatted output.

> > > The 'target' in teh above sentence I believe is refering to when GDB is
> > > using a remote protocol to a specific piece of hardware. It's not
> > > refering to the host.
> > 
> > Ok, then it's not clear to me either. There's specific packet in remote 
> > protocol ("OXXXX") which allows to pass arbitrary text from remote side to 
> > gdb. Is this what's printed with "@". Or there some other messages from 
> > remote that are also printed with "@" prefix?
> 
> I'm not sure. I've never seen output with the "@" before it. If you are
> on the host, you will not get the "@" before the I/O from the inferior
> process. Someone else might be able to give you more details on when
> target I/O is done, if at all.

Bob was right again; it's used for the remote console output packets
and was never implemented for anything else.

At this point I suspect it should be removed from the MI.

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-11-18 15:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-18 12:34 Output from target in MI mode Vladimir Prus
2005-11-18 13:48 ` Bob Rossi
2005-11-18 14:43   ` Vladimir Prus
2005-11-18 14:47     ` Bob Rossi
2005-11-18 15:31       ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).