public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Re: SIGINT handling for rdi target
       [not found]     ` <39A54367.462E895C@firetalk.com>
@ 2000-08-24  9:17       ` Grant Edwards
  2000-08-24  9:33         ` Keith Seitz
  0 siblings, 1 reply; 2+ messages in thread
From: Grant Edwards @ 2000-08-24  9:17 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

On Thu, Aug 24, 2000 at 08:46:47AM -0700, Keith Seitz wrote:

> > I'll look into it.  I'm the one who submitted the patches to
> > gdb to make this target interruptible, so it's probably
> > something I did wrong.
> 
> It's not likely that you broke it, per se. I don't ever remember doing
> anything like this for RDI before. In any case, this should still work
> on unix (which uses an itimer), I should think...

I just tried it under Linux, and verified that sending a SIGINT
to gdb interrupts the target and doesn't lock up the GUI
unless I wait too long to acknowlege the popup dialog box and
end up with the watchdog timer on the target timing out.  Under
Cygwin, it sometimes locks up the GUI, and sometimes not.

[The lock-up when the target watchdog timer times out is
because The rdi library is sort of fragile. It doesn't
tolerate situations where it doesn't get an expected response
from the target. That's been annoying me for quite a while, but
not enough that I've actually fixed the problem.]

However, under both Cygwin and Linux the GUI is locked _until_
I send a SIGINT, so there's no way to actually click the stop
button.  Even if there were, I'm not sure it would do anything
useful.

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.

The next problem is getting target_stop() to set the same flag
that is set by the rdi sigint handler routine in order to tell 
angel_RDI_ExecuteOrStep() to stop the target and return.  I've
got to go look and see what target_stop() actually does.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: SIGINT handling for rdi target
  2000-08-24  9:17       ` SIGINT handling for rdi target Grant Edwards
@ 2000-08-24  9:33         ` Keith Seitz
  0 siblings, 0 replies; 2+ messages in thread
From: Keith Seitz @ 2000-08-24  9:33 UTC (permalink / raw)
  To: Grant Edwards; +Cc: insight

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-08-24  9:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20000823155500.A19850@visi.com>
     [not found] ` <39A51866.8752490A@firetalk.com>
     [not found]   ` <20000824104015.B9059@visi.com>
     [not found]     ` <39A54367.462E895C@firetalk.com>
2000-08-24  9:17       ` SIGINT handling for rdi target Grant Edwards
2000-08-24  9:33         ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).