This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: gdb/671: Changing GDB/MI spec say the should be a termination
- From: "Alain Magloire" <alain at qnx dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 27 Aug 2002 03:18:01 -0000
- Subject: Re: gdb/671: Changing GDB/MI spec say the should be a termination
- Reply-to: "Alain Magloire" <alain at qnx dot com>
The following reply was made to PR gdb/671; it has been noted by GNATS.
From: "Alain Magloire" <alain@qnx.com>
To: drow@mvista.com (Daniel Jacobowitz)
Cc: alain@qnx.com (Alain Magloire), gdb-gnats@sources.redhat.com
Subject: Re: gdb/671: Changing GDB/MI spec say the should be a termination
Date: Mon, 26 Aug 2002 23:10:20 -0400 (EDT)
>
> On Mon, Aug 26, 2002 at 07:38:00PM -0000, Alain Magloire wrote:
> > > > 1:int main() {
> > > > 2: int x;
> > > > 3: pthread_create(NULL, NULL, routine, NULL);
> > > > 4: printf("Hello world\n");
> > > > 5: sleep(200000); // Or a very time consuming function called.
> > > > 6: printf("After the long wait\n");
> > > > 7: return 0;
> > > > 8:}
> > > >
> > > > gdb/mi will issue things like:
> > > > (gdb)
> > > > -break-insert file.c:6
> > > > ^done,bkpt={...}
> > >
> > > Is there a ``run/continue'' missing in here somewhere?
> >
> > Yes.
> >
> > >
> > > > ~"[New Thread 1024 (LWP 30497)]\n"
> > > > ~"[Switching to Thread 1024 (LWP 30497)]\n"
> > > > .... wait for the sleep ....
> > > > *stopped,reason=...
> > > > (gdb)
> > > >
> > > > You do not have the "(gdb)" comming right away.
> > > >
> > > > OUTPUT ==> (OUT-OF-BAND-RECORD)* [RESULT-RECORD] "(gdb)"nl
> > > >
> > > > I read the definition like you can accumulate outputs and deal with them only
> > > > when encounter "(gdb)" which is true unless you want to wait for the sleep() to
> > > > finish. In practice we can consider Out-of-band completely async and should be
> > > > process right away. It was not clear at first sight, IMHO.
> > >
> > > Is this an async target (target remote-async)? No current native target
> > > is async. This makes correctly implemeting out-of-band messages very
> > > difficult.
> >
> > This goes for any streams(log/target/console).
> >
> > Changing the syntax to something like:
> >
> > OUTPUT ==> (OUT-OF-BAND-RECORD)* | [RESULT-RECORD] "(gdb)"nl
> > ^^^^
> >
> > Is probably more accurate. GDB(console-stream) will send oob's like
> > creating new thread etc ... at any time.
> >
> > But you say "no current native" is asyn, which seems to say that remote
> > is. On GNU/Linux gdb-5.2.1 using gdbserver target streams are not asyn
> > i.e properly MI wrap either.
>
> No, "target remote-async" is. Gdbserver does not implement that (yet,
> or until it seems like a good idea).
>
Sorry, I did not follow your reply.
I do not know, what "target remote-async" is. I guess you mean that it is the
mechanism/protocol that can wrap target-stream output in gdb/mi.
That would be very nice.
Keith Seizt was pointing out that the problem is not trivial and for
applications that need terminal(or X), say "vi", it is a problem.
But having proper gdb/mi even if it's only work using "remote"(on localhost)
is good start.
> --
> Daniel Jacobowitz
> MontaVista Software Debian GNU/Linux Developer
>