Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Bjarke Viksoe" <bviksoe@hotmail.com>
To: gdb@sourceware.org
Subject: Re: asynchronous MI output commands
Date: Mon, 08 May 2006 00:36:00 -0000	[thread overview]
Message-ID: <BAY111-F324193CD932C6EC7857A8BA0AB0@phx.gbl> (raw)
In-Reply-To: <20060507220145.GA19231@nevyn.them.org>

> > >
> > >If I were writing a front-end, I would have an arbitration layer which
> > >sent questions to GDB and received answers.  The answers will come back
> > >one at a time, in the same order the questions were asked.  If you send
> > >two -var-evaluate-expression commands, you'll get back two answers, in
> > >that same order.
> > >
> > >Am I missing something?  Is there a reason that this isn't enough?
> > ...
> >
> >
> > Because of the latency, my "abstraction layer" runs in its own thread. 
>This
> > makes the UI wonderfully responsive, but doesn?t allow a component/view 
>to
> > submit a command and read the answer in the same context. Answers arrive
> > out of context and are processed separately - creating a high need to 
>know
> > what the answer originated from.
>
>Sorry, but I don't feel like you've answered my question.  Why does
>this interfere with pipelining?
>
>Thread A:
>   - gdb_thread.submit_question("-var-evaluate-expression A")
>Thread B:
>   - gdb_thread.submit_question("-var-evaluate-expression B")
>GDB thread:
>   - Send "-var-evaluate-expression A".  Record this as an outstanding
>     request.
>   - Send "-var-evaluate-expression B".  Record this as an outstanding
>     request.
>   - Notice that data is available.
>   - Parse it, and notice that it is a response to a command.  Take the
>     first command off the queue of outstanding requests.  See that it
>     is -var-evaluate-expression A.  Return the answer to that request's
>     submission object, in whatever way you need to.
>   - Notice that more data is available... etc.
>
>If this isn't workable, can you fill in the piece I'm missing?  Why
>not?  Each command should generate a single synchronous (^done, ^error)
>response.
>

Right. When I was testing all this I ran into more trouble. I would actually 
see something like this:

(gdb) -var-evaluate-expression A
^done,value="12-var-evaluate-expression A
34"
(gdb)
^done,value="1234"

...because of the lack of flow-control in the telnet/SSH session (notice how 
the next command is embedded in the output of the first). This put me back 
to square#1 since there was now no 1:1 relationship between cmd/answ. While 
I agree that your plan is workable, I just concluded that keeping track of a 
command-list wasn't a reliable option without some severe pain when recovery 
was needed (aka back to the <token> option) - and I didn't feel that I was 
getting any closer to having a state-less component.

I would expect that some front-ends (GUI based ones) will employ a similar 
design as mine - even if they are in an environment more attached to their 
GDB - since we've already seen that fireing a backtrace-type command for 
every step can be very slow and would block the UI unreasonably if not 
batched in a thread other than the main GUI one.
My take was that I assumed that the output was more detailed simply because 
it would make my life easier in handling the returned output - instead of 
having to build complex schemes just to call a simple GDB command.

bjarke



  reply	other threads:[~2006-05-07 22:50 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-07 22:30 Bjarke Viksoe
2006-05-07 22:50 ` Daniel Jacobowitz
2006-05-08  0:36   ` Bjarke Viksoe [this message]
2006-05-08  1:52     ` Daniel Jacobowitz
2006-05-11 10:31 ` MI: anynchronous vs. synchronous Vladimir Prus
  -- strict thread matches above, loose matches on Subject: below --
2006-05-12  0:19 asynchronous MI output commands Alain Magloire
2006-05-11 15:02 Alain Magloire
2006-05-11 15:42 ` Bob Rossi
2006-05-11 16:40   ` Jim Ingham
2006-05-11 17:03     ` Daniel Jacobowitz
2006-05-11 17:35       ` Jim Ingham
2006-05-11 19:24     ` Bob Rossi
2006-05-11 19:25       ` Jim Ingham
2006-05-10 22:15 Alain Magloire
2006-05-11  3:41 ` Bob Rossi
2006-05-11  8:58   ` Vladimir Prus
2006-05-11 10:48     ` Bob Rossi
2006-05-11 10:52       ` Vladimir Prus
2006-05-11 11:14         ` Bob Rossi
2006-05-11 12:50           ` Vladimir Prus
2006-05-11 14:50             ` Bob Rossi
2006-05-09  9:46 Alain Magloire
     [not found] <1147034156.28828.ezmlm@sourceware.org>
2006-05-07 21:27 ` Bjarke Viksoe
2006-05-07 21:41   ` Daniel Jacobowitz
2006-05-10 12:43     ` Vladimir Prus
2006-05-06  1:26 Bob Rossi
2006-05-06  1:59 ` Daniel Jacobowitz
2006-05-06  2:48   ` Bob Rossi
2006-05-06  3:37     ` Nick Roberts
2006-05-06 15:20       ` Bob Rossi
2006-05-06  4:06     ` Daniel Jacobowitz
2006-05-06  4:05       ` Daniel Jacobowitz
2006-05-06 11:53       ` Bob Rossi
2006-05-06 12:06         ` Bob Rossi
2006-05-06  3:14   ` Bob Rossi
2006-05-06  4:04     ` Nick Roberts
2006-05-06 11:49       ` Daniel Jacobowitz
2006-05-06 11:50         ` Bob Rossi
2006-05-06 16:52           ` Daniel Jacobowitz
2006-05-06 19:45             ` Bob Rossi
2006-05-06 20:37               ` Daniel Jacobowitz
2006-05-07  0:44                 ` Bob Rossi
2006-05-07 20:35                   ` Daniel Jacobowitz
2006-05-07 20:42                     ` Bob Rossi
2006-05-07 22:01                       ` Daniel Jacobowitz
2006-05-08  1:22                         ` Bob Rossi
2006-05-08  2:03                           ` Daniel Jacobowitz
2006-05-09 21:48                             ` Bob Rossi
2006-05-08  6:38                           ` Nick Roberts
2006-05-08 11:28                             ` Bob Rossi
2006-05-08  1:26                         ` Bob Rossi
2006-05-06 11:51       ` Bob Rossi
2006-05-06  3:27 ` Nick Roberts
2006-05-06 16:40   ` Bob Rossi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BAY111-F324193CD932C6EC7857A8BA0AB0@phx.gbl \
    --to=bviksoe@hotmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox