This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


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

Re: Stopping target in Insight


On Fri, 31 Aug 2001, Yuri Karlsbrun wrote:

> I did gdb port for our processor. I had no problems with implementing signal
> handler for command line version of gdb, but I don't know how to make
> Insight's console react to CTRL-C or Main window react to hitting the "STOP"
> button. More general, how to make GUI react to X-events while gdb is
> running.

Hi,

Okay, this is actually a very, very complicated thing. It should be
trivial, but it is not.

There is a hook that can be called to allow the UI to update:
ui_loop_hook. This function (if non-null) can be called from your target's
wait routine. Care should be taken that it is not called too often,
though. (Yeah, this all sucks, but it is the best we can do with some
hosts/targets.)

ui_loop_hook will return non-zero if the UI (Insight in your case) wants
to detach from the target. If Control-C works from the command-line, then
you're pretty much done, since Insight will call the appropriate target
method to do the stop.

You cannot use Control-C in a gui: Control-C has always meant "copy" to a
gui. You must use the stop button.

There is a very complicated methodology that Insight uses right now to
deal with target_wait and stops. It is probably needlessly complicated
today, but three years ago, it was needed. If you really want the yicky
details, take a peek at the comments in gdbtk-hooks.c near x_event ().

Good luck.
Keith




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