Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Keith Seitz <keiths@cygnus.com>
Cc: Elena Zannoni <ezannoni@cygnus.com>,
	gdb@sources.redhat.com, insight <insight@sources.redhat.com>
Subject: Re: [RFC] Inferior stop events
Date: Fri, 15 Jun 2001 13:44:00 -0000	[thread overview]
Message-ID: <3B2A73C8.5040106@cygnus.com> (raw)
In-Reply-To: <Pine.GSO.4.33.0106151048310.29589-100000@makita.cygnus.com>

> 2) It's not an event source! It posts no events to the event queue...
> 
> Even if we could put some sort of event posting into
> inferior_event_handler, we're STILL missing reasons for the stop, which
> (was) already known by the time this function is called.


For an async target, MI returns to the event-loop, at some later stage, 
GDB notifies MI that the target has stopped via the function 
mi_exec_async_cli_cmd_continuation() which was registered using 
add_continuation(). It is simply unfortunate that, for synchronous 
targets it uses another more nasty mechanism (fakeing asynchronous 
behavour).


> I'm sorry, but I just don't see how this conflicts with what I've done.
> IMO, gdb-events.sh and my proposed change is correct (or is at least
> closer to being correct). What MI does (print_stop_reason modification) is
> wrong. It does not generate an event, which is not hard to believe, given
> that MI is really not event driven. It's just another command line with
> different input/output syntaxes.


MI (ui-out, ui-filek, libgdb, event hooks, ...) is an architecture.  The 
top level happens to look like ``just another command line with 
different input/output syntaxes''.

Anyway, there is a far more important and underlying issue here. Insight 
needs to start putting some distance between its self and GDB - it can 
no longer assume certain GDB internals.  Knowing this needed to happen 
was one of the motivations behind the MI design.

With that in mind.  The only messages/events I'd expect GDB to send to 
clients are very simple vis:

	o	target busy
	o	target ready

longer term that might get expanded into:

	o	thread created/running/stopped/dead

The important thing is that GDB provides the absolute minimum of 
information and certainly not internal details.  The assumption is that 
the client will then, later, extract the details it needs from GDB using 
a ``libgdb/ui-out'' query.

As an example, look at the breakpoint interface.  The breakpoint events 
(created, changed, deleted) only include the breakpoint number.  It is 
assumed that the client will (when GDB is idle) extract the details 
using gdb_breakpoint_query() and a ui-out builder.

In the case of insight, it could use the above.  Alternativly, it could 
implement the more robust model:

   GDB                 event handler            insight
          -> stopped ->       |
          -> started ->       |
          -> stopped ->       |
                              |
     .-< stop-reason(uiout)? <'
     |
     `--> uiout = reason >----.
                              |
	                     `-> target-stop-event ->

The middle component (event hander) would, at it leasure, extract the 
stop reason from GDB and then pass it onto insight.

	Andrew





      reply	other threads:[~2001-06-15 13:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-13 13:45 Keith Seitz
2001-06-14  0:59 ` Eli Zaretskii
2001-06-14  8:13   ` Keith Seitz
2001-06-14  9:00     ` Eli Zaretskii
2001-06-15  0:10 ` Andrew Cagney
2001-06-15  7:38   ` Keith Seitz
2001-06-15 10:44     ` Elena Zannoni
2001-06-15 10:58       ` Keith Seitz
2001-06-15 13:44         ` Andrew Cagney [this message]

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=3B2A73C8.5040106@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=ezannoni@cygnus.com \
    --cc=gdb@sources.redhat.com \
    --cc=insight@sources.redhat.com \
    --cc=keiths@cygnus.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