This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFC] Inferior stop events


[I'm going to add Insight as this is really an insight architecture question]


> Hi,
> 
> The next part of my ongoing quest to get information out of gdb:
> inferior_stop events. These events are to inform a UI that the inferior
> has stopped running and why it has stopped.
> 
> I propose to take "enum stop_reason" from infrun.c and move it into
> inferior.h. This enum will be used by both print_stop_reason (which is
> really a cli function) and user interfaces, like Insight. (Pretend I
> didn't say that.)
> 
> It is then my intention to litter infrun.c with event notifications, which
> provide a reason for the stop, and some supplemental info on the stop
> (signal, exit status, breakpoint#, etc).
> 
> Does this sound like a reasonable approach?


It sounds wrong.  Have you looked at what MI did?


> Your comments and recommendations appreciated.
> Keith


Keith,

The thing I don't understand in all this is how GDB / Insight will be 
coupled together.  Right now I would draw things as:

	Insight
	   |
	hook()
	  |
	GDB internals
	  |
	Event Loop

 
I think everyone agreed this was wrong long ago.  It should be:


	GDB Internals -> message -> Insight
	   |                           |
	   -------- Event Loop ---------


That is, instead of Insight sitting on top of GDB processing stuff 
instantly, Insight would sit adjacent to GDB, allow GDB to complete its 
processing and *then* start processing any events it has outstanding.

In such a model, I don't think any (or very few) hooks are needed. 
Insight can find out the stop reason by asking GDB (just like MI did). 
All GDB needs to do is tell insight that the program state changed.

	Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]