public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Jan Vrany <jan.vrany@fit.cvut.cz>,
	"gdb@sourceware.org" <gdb@sourceware.org>
Cc: "Joel Brobecker" <brobecker@adacore.com>,
	"Tom Tromey" <tom@tromey.com>,
	"André Pönitz" <apoenitz@t-online.de>,
	"Jonah Graham" <jonah@kichwacoders.com>
Subject: Re: MI3 and async notifications
Date: Tue, 18 Jun 2019 03:14:00 -0000	[thread overview]
Message-ID: <7530cc91-5457-0a84-57a4-5b64ddb95f13@simark.ca> (raw)
In-Reply-To: <70fdd9107d9bb3cee0a1a342aedc05bf3c8e9bae.camel@fit.cvut.cz>

On 2019-06-10 5:19 p.m., Jan Vrany wrote:
> Hello,
> 
> as an user og GDB/MI (and frontent developer), I'd like to 
> open a discussion about one aspect of MI that I'd like to change
> in MI3 before it is released into the wild. 

Hi Jan and others,

Thanks, nice to see some action on improving MI.

I have just read the thread, and I have a few questions about where
this is going.

> Currently, quite a few commands suppress async notifications when
> a command is issued through MI. For example, when a breakpoint is 
> added using -break-insert then =breakpoint-created is not emitted.
> 
> At least in my case, this behavior complicates client design because
> now the client has to care for new breakpoints on multiple places:
> (i)  listen to breakpoint created events to handle cases where breakpoint
>      is added via CLI. 
> (ii) do similar processing whenever MI returns ^done for previously 
>      issued -break-insert command.
>  
> This leads to a complex logic, especially in cases where frontend has
> some scripting support (so execution of MI commands is not completely
> under frontend developer's control).
>
> Emitting notifications unconditionally would simplify things a lot 
> - again at least in my case.

The idea of the current behavior is that you shouldn't be asynchronously notified
of the result of your own command.  As was illustrated in this thread, it would be
difficult to determine whether a =breakpoint-created async notification is the result
of the pending -break-insert, or it just happens that the user has created a breakpoint
on the CLI at the same time.  So to remove this ambiguity, we don't send the notification.

I am skeptical about the complex logic you are talking about to handle both
=breakpoint-created notifications and responses to the -break-insert.  Both contain pretty
much the same information.  So rather than adding an option in GDB for emitting async
notifications unconditionally, can't you just process both using the same function?  That
doesn't really complicated, but maybe I am misunderstanding your problem, in which case
please expand.

It would be useful to have a very concrete use case where you could point out "see here,
I am missing some info and a notification would be useful".  It could very well be that
some notifications are just missing.  For example I would argue we are missing notifications
if using two MI clients (through the new-ui command, although I don't remember if that's
"officially" supported).  If one of the MI client inserts a breakpoint with -break-insert,
the other one is not notified.  I would consider that a bug that the second client doesn't
get a =breakpoint-created.

Also, I am a bit worried by a proposal in the thread, which would be to remove information
from the -break-insert ^done response, arguing that the async notification would have already
been emitted.  It is clear and unambiguous how to map a response to a request, but it would not
be obvious to map an async notification to a request.  So it appears to me as a regression in
functionality.

Simon

  parent reply	other threads:[~2019-06-18  3:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10 21:19 Jan Vrany
2019-06-10 23:23 ` Jonah Graham
2019-06-11  8:50   ` Jan Vrany
2019-06-11 13:37     ` Jonah Graham
2019-07-05 20:00       ` Pedro Alves
2019-07-05 21:58         ` Jonah Graham
2019-06-15 14:34 ` Tom Tromey
2019-06-17 10:53   ` Jan Vrany
2019-06-17 12:11     ` Jonah Graham
2019-06-17 12:14     ` Joel Brobecker
2019-06-17 12:26       ` Jonah Graham
2019-06-17 12:56         ` Joel Brobecker
2019-06-17 13:12           ` Jonah Graham
2019-06-17 13:12           ` Jan Vrany
2019-06-17 13:23             ` Jonah Graham
2019-06-17 20:45               ` Joel Brobecker
2019-06-17 20:58                 ` Jan Vrany
2019-06-17 21:50                   ` Jonah Graham
2019-06-17 19:52     ` André Pönitz
2019-06-18  3:14 ` Simon Marchi [this message]
2019-06-18 20:38   ` Jan Vrany
2019-06-19 15:29     ` Simon Marchi
2019-06-19 20:58       ` Jan Vrany
2019-06-20 15:31         ` Simon Marchi
2019-06-20 20:46           ` Jan Vrany
2019-07-05 19:35           ` Pedro Alves

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=7530cc91-5457-0a84-57a4-5b64ddb95f13@simark.ca \
    --to=simark@simark.ca \
    --cc=apoenitz@t-online.de \
    --cc=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=jan.vrany@fit.cvut.cz \
    --cc=jonah@kichwacoders.com \
    --cc=tom@tromey.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).