From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Seitz To: Grant Edwards Cc: insight@sourceware.cygnus.com Subject: Re: SIGINT handling for rdi target Date: Thu, 24 Aug 2000 09:33:00 -0000 Message-id: <39A54E43.78FF0B8E@firetalk.com> References: <20000823155500.A19850@visi.com> <39A51866.8752490A@firetalk.com> <20000824104015.B9059@visi.com> <39A54367.462E895C@firetalk.com> <20000824111745.A9462@visi.com> X-SW-Source: 2000-q3/msg00209.html Grant Edwards wrote: > > The problem is that there's a routine down inside the rdi > library called angel_RDI_ExecuteOrStep. When you do a "step" > or "cont" this routine ends up getting called, and it doesn't > return until the target stops or it gets a SIGINT. The rdi > library installs its own SIGINT handler which sets a flag to > tell angel_RDI_ExecuteOrStep() to interrupt the target, clean > up, and return. This sigint handler is only active while the > target is executing. > > The first problem is keeping the GUI alive while > angel_RDI_ExecuteOrStep() is waiting for the target to stop. Well, I'll address what I know about this... Deep down, someone must do a read (). Well, when it does, it is probably doing a blocking read. Gdb used to do this, too. I changed it so that instead of blocking indefinitely (or for N seconds), it would block for an infinite number of one-second intervals (or N one-second intervals). This way, at the end of every interval, we could call ui_loop_hook. Also note that ui_loop_hook will return a value when the user requests a stop. You could use this info to force the target to stop... We used this in the serial code, too.. See do_hardwire_readchar in ser-unix.c. Keith