Daniel Jacobowitz wrote: > On Wed, Feb 27, 2008 at 10:44:56PM +0000, Antony KING wrote: >> The signal handler is the restored default handler, "handle_sigint". My >> target interface only substitutes that default SIGINT handler when >> implementing the target_wait() functionality (it is modelled on remote.c). >> >> My first thought was that QUIT should achieve the effect I need but >> quit_flag, as was pointed out, is not being set soon enough. Also, >> forcing an immediate_quit is not suitable since I would like to stop the >> stepping cleanly with a target SIGINT (plus it breaks my target >> interface, but that is my problem :-). > > Why doesn't quit_flag get set? That's how I think we ought to do > this. Avoid immediate_quit, that's dangerous to mess with. In my grep'ing of the (6.6) sources, I could only find quit_flag being set when async_request_quit() is called, by the event processing loop. It is also set in request_quit() but this API does not seem to be used. > I'm not sure why you'd want to use a target SIGINT for this case. > If we're between steps, we should just make sure we don't send > another step. I suppose I hadn't thought about the case between > stepping and waiting... I was thinking that a target SIGINT notification would be suitable since this is what the user would see if they interrupted a continue; I did not think interrupting a step, from a user perspective, would be any different. Of course, it is a lie since the target did not generate the SIGINT and so this would be confusing, although for the targets I have to support this is not a problem. Also, it was just easier for me to see how to apply a fix without getting too mired in understanding how the target event handling worked in handle_inferior_event() :-) and the mechanics of cleanly stopping. Anyway, I have attached a patch fyi, which is my attempt at providing a solution using a faked target SIGINT which seems to work for me. It is a bit of a bodge since it subverts the main event loop but ce la vie. Cheers, Antony.