MI3 and async notifications

Jonah Graham jonah@kichwacoders.com
Mon Jun 17 13:23:00 GMT 2019

On Mon, 17 Jun 2019 at 09:12, Jan Vrany <jan.vrany@fit.cvut.cz> wrote:

> On Mon, 2019-06-17 at 08:56 -0400, Joel Brobecker wrote:
> > > I do agree, avoid the extra configurability - but I simply don't know
> how
> > > to work with just async notifications to sync messages. It means that
> > > will have to issues the -break-insert, look for the done message and
> > > "search" between them to find the =breakpoint-created that matched and
> > > separately process any that don't. Please see my earlier message about
> how
> > > to handle race condition between -break-inserts over MI and breaks
> inserted
> > > from CLI. This race condition does not happen during normal operation
> > > (where a human is driving everything) but does kick in during many
> > > semi-automated flows. Perhaps this isn't a big problem, but to me it
> seems
> > > the logic to match up -break-insert to =breakpoint-created in client
> side
> > > is complex and bug prone.
> >
> > The part I don't understand is why it matters to sync the two.
> >
> Jonah, I was about to ask the same. I understand that you need to know
> which breakpoint has been inserted by given command, but this
> if we respond with something like
> 1-break-insert main
> =breakpoint-created,bkpt={number="1",type=...}
> 1^done,bkpt-number=1
> then you just search for breakpoint with that id, no? Given that MI
> guarantees that =breakpoint-created arrives before ^done reply to command.
> Am I missing something?

No you aren't missing anything. That would be a perfectly acceptable
solution for CDT.

There would still be some other new logic needed for CDT, we would still
have to store all the =breakpoint-created if there is a -break-insert
active and then process all of them when the ^done is received. However
that seems fairly reasonable.

> Also note that this is not only about breakpoints but also about things
> like
> -gdb-set and few others.

?? This is down to me not following closely enough. If you can point me in
the right direction then I can provide feedback now. If not it will have to
wait until if/when CDT needs to update to MI3 support. However there are no
gdb-sets that are likely to have any such issues as there is little to no
UI elements connected to gdb-sets. CDT does all of its gdb-sets at startup
to set the environment and then does not normally change any of them.


More information about the Gdb mailing list