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: SIGINT handling for rdi target


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

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