public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Can gdbmi process many commands at once?
@ 2015-03-20  1:21 Bob Rossi
  2015-03-20  5:40 ` Vladimir Prus
  0 siblings, 1 reply; 3+ messages in thread
From: Bob Rossi @ 2015-03-20  1:21 UTC (permalink / raw)
  To: gdb

Hi,

I'm trying to determine if GDB/MI has the capability of accepting and
working on multiple commands at once?

For instance, if I run these commands,
    (gdb) 
    123-interpreter-exec console "p argc"
    ~"$3 = 1"
    ~"\n"
    123^done
    (gdb) 
    234-interpreter-exec console "p argv[1]"
    ~"$4 = 0x0\n"
    234^done

Is there any mode in which the command,
    234-interpreter-exec console "p argv[1]"
will be worked on before
    123-interpreter-exec console "p argc"
is finished?

The implication is that i'm expecting to have at most 1 command active
with GDB at a time. I'm curious if there is a situation where a front
end could have many active commands at a time. By active I mean, 
I issue several commands, and then some time later, I get a response
on each of these, in any order.

Thanks,
Bob Rossi

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

* Re: Can gdbmi process many commands at once?
  2015-03-20  1:21 Can gdbmi process many commands at once? Bob Rossi
@ 2015-03-20  5:40 ` Vladimir Prus
  2015-03-20 13:39   ` Marc Khouzam
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Prus @ 2015-03-20  5:40 UTC (permalink / raw)
  To: gdb

On 03/20/2015 04:22 AM, Bob Rossi wrote:
> Hi,
>
> I'm trying to determine if GDB/MI has the capability of accepting and
> working on multiple commands at once?
>
> For instance, if I run these commands,
>      (gdb)
>      123-interpreter-exec console "p argc"
>      ~"$3 = 1"
>      ~"\n"
>      123^done
>      (gdb)
>      234-interpreter-exec console "p argv[1]"
>      ~"$4 = 0x0\n"
>      234^done
>
> Is there any mode in which the command,
>      234-interpreter-exec console "p argv[1]"
> will be worked on before
>      123-interpreter-exec console "p argc"
> is finished?
>
> The implication is that i'm expecting to have at most 1 command active
> with GDB at a time. I'm curious if there is a situation where a front
> end could have many active commands at a time. By active I mean,
> I issue several commands, and then some time later, I get a response
> on each of these, in any order.

Bob,

it is not possible with the current GDB. All of the commands are executed in the single
thread GDB has, in the order they were received.

It is possible, in theory, that somebody will require GDB in node.js, or introduce asynchronous
operation using boost.asio or similar, but that's quite unlikely scenario.

-- 
Vladimir Prus
CodeSourcery / Mentor Embedded
http://vladimirprus.com

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

* RE: Can gdbmi process many commands at once?
  2015-03-20  5:40 ` Vladimir Prus
@ 2015-03-20 13:39   ` Marc Khouzam
  0 siblings, 0 replies; 3+ messages in thread
From: Marc Khouzam @ 2015-03-20 13:39 UTC (permalink / raw)
  To: Vladimir Prus, gdb

> From: gdb-owner@sourceware.org [gdb-owner@sourceware.org] on behalf of Vladimir Prus [vladimir@codesourcery.com]
> Sent: March 20, 2015 1:40 AM
> To: gdb@sourceware.org
> Subject: Re: Can gdbmi process many commands at once?
> 
> On 03/20/2015 04:22 AM, Bob Rossi wrote:
> > Hi,
> >
> > I'm trying to determine if GDB/MI has the capability of accepting and
> > working on multiple commands at once?
> >
> > For instance, if I run these commands,
> >      (gdb)
> >      123-interpreter-exec console "p argc"
> >      ~"$3 = 1"
> >      ~"\n"
> >      123^done
> >      (gdb)
> >      234-interpreter-exec console "p argv[1]"
> >      ~"$4 = 0x0\n"
> >      234^done
> >
> > Is there any mode in which the command,
> >      234-interpreter-exec console "p argv[1]"
> > will be worked on before
> >      123-interpreter-exec console "p argc"
> > is finished?
> >
> > The implication is that i'm expecting to have at most 1 command active
> > with GDB at a time. I'm curious if there is a situation where a front
> > end could have many active commands at a time. By active I mean,
> > I issue several commands, and then some time later, I get a response
> > on each of these, in any order.
> 
> Bob,
> 
> it is not possible with the current GDB. All of the commands are executed in the single
> thread GDB has, in the order they were received.
> 
> It is possible, in theory, that somebody will require GDB in node.js, or introduce asynchronous
> operation using boost.asio or similar, but that's quite unlikely scenario.

Eclipse, for example, is dependent on MI commands being processed as they are
sent.  It allows the front-end to send multiple commands at once (Eclipse goes up to 3) without
worrying about it causing problems of ordering.

Marc

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

end of thread, other threads:[~2015-03-20 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-20  1:21 Can gdbmi process many commands at once? Bob Rossi
2015-03-20  5:40 ` Vladimir Prus
2015-03-20 13:39   ` Marc Khouzam

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).