public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Re: Ctrl-C strange behavior
@ 2000-05-16 11:08 Will Lentz
  2000-05-22  7:58 ` Elena Zannoni
  0 siblings, 1 reply; 11+ messages in thread
From: Will Lentz @ 2000-05-16 11:08 UTC (permalink / raw)
  To: leonp; +Cc: Insight

Hi Leon & all,

Leon Pollak wrote:
> 
> Hello, gurus.
>     Please, can somebody describe rather strange behavior of Ctrl-C that I
have?
>     I run Insight from xterm and the program downloads to the target and
starts to run.
>     When I press Ctrl-C in command window, press "STOP" button or try
close Insignt -
>     nothing happens.
>     Even the windows are not redrawn and remain blank if I minimize them.
>     But when I press Ctrl-C from the xterm window, Insignt says that it
received
>     SGINT interrupt and stops the target.
> 

I was having the same problem under Linux and Windows 98 
with the 2000-05-15 insight+dejagnu snapshot (connecting
to an extended-remote target over TCP).

Under Linux, I found a workaround (see the diff below).
Under Windows, the Insight window now updates but I don't
get a stop button.  I also tried the patch about __CYGWIN32__
on gdbtk.c, and that did not work for me.  

There's most probably a better way to do the workaround, but basically:
 1- ser_unix_wait_for was getting called with a timeout=-1,
    so it hung the GUI.  Now everything has a timeout.
 2- read() was hanging when status==SERIAL_TIMEOUT.  I don't 
    know why I set status to 0 in this case (but it works).

Will

PS- Anyone have better luck with Ctrl-C and Insight in Windows?

PPS-
Here's the diff -u -p :
--- ser-unix.c  Tue Mar 28 00:24:28 2000
+++ ser-unix2.c Tue May 16 10:36:53 2000
@@ -875,11 +875,13 @@ ser_unix_wait_for (serial_t scb, int tim
 
   while (1)
     {
-      if (timeout >= 0)
+      if (timeout > 0)
        numfds = select (scb->fd + 1, &readfds, 0, &exceptfds, &tv);
-      else
-       numfds = select (scb->fd + 1, &readfds, 0, &exceptfds, 0);
-
+      else {
+        tv.tv_sec = 1;
+        tv.tv_usec = 0;
+        numfds = select (scb->fd + 1, &readfds, 0, &exceptfds, &tv);
+      }
       if (numfds <= 0)
        {
          if (numfds == 0)
@@ -936,7 +938,10 @@ do_unix_readchar (serial_t scb, int time
       if (status == SERIAL_ERROR)
         return status;
 
-      status = read (scb->fd, scb->buf, BUFSIZ);
+      if( status != SERIAL_TIMEOUT )
+        status = read (scb->fd, scb->buf, BUFSIZ);
+      else
+        status = 0;
 
       if (status <= 0)
         {

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: Ctrl-C strange behavior
@ 2000-05-22  9:14 Will Lentz
  2000-05-22  9:18 ` Elena Zannoni
  0 siblings, 1 reply; 11+ messages in thread
From: Will Lentz @ 2000-05-22  9:14 UTC (permalink / raw)
  To: Elena Zannoni; +Cc: Insight

Elena,

ok - I'll give it a shot tonight.  Does the 20000522
snapshot contain the patch?

Thanks,
Will

PS- I did try the patch manually when it was first 
 posted, but maybe I screwed up :).

> -----Original Message-----
> From: Elena Zannoni [ mailto:ezannoni@cygnus.com ]
> Sent: Monday, May 22, 2000 7:57 AM
> To: Will Lentz
> Cc: leonp@plris.com; Insight
> Subject: Re: Ctrl-C strange behavior
> 
> 
> Will, 
> I just committed the patch I posted a few days back for this
> problem. Can you see if it helps?
> 
> Thanks
> Elena
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ctrl-C strange behavior
@ 2000-05-05 13:30 Scott A Sumner
  2000-05-12 11:11 ` Elena Zannoni
  0 siblings, 1 reply; 11+ messages in thread
From: Scott A Sumner @ 2000-05-05 13:30 UTC (permalink / raw)
  To: insight

Chris (& others)--

Actually it looked like there were three routines to hit:

1) gdbtk_start_timer
2) gdbtk_stop_timer
3) target_should_use_timer

I pulled the #ifdef conditionals out, and left the 'return's in.
Did I make the right call here?



>>My problem:  If my target runs at full speed, I have no way to tell
>>Insight I want to break execution wherever it happens to be.  As 
>>soon as
>>I hit the continue button, Insight changes the cursor to an 
>>hourglass and
>>just hangs (if I don't have a breakpoint set that execution will 
>>hit).  I
>>can't do anything except kill gdb and restart it.  I want to press 
>>the
>>stop button but as Insight appears to be hung at this point, it 
>>doesn't
>>work.  This is *extremely* annoying; anyone have any idea why it 
>>does
>>this and what the solution/workaround might be?
 
> Try removing the "#ifdef __CYGWIN32__" (sic) conditional in 
> gdbtk_start_timer
> and also try using the latest cygwin net release.  It's available 
> at:
> 
> http://sourceware.cygnus.com/cygwin/
> 
> cgf

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Ctrl-C strange behavior
@ 2000-05-03 17:00 Scott A Sumner
  2000-05-03 17:45 ` Chris Faylor
  2000-05-04  8:58 ` Keith Seitz
  0 siblings, 2 replies; 11+ messages in thread
From: Scott A Sumner @ 2000-05-03 17:00 UTC (permalink / raw)
  To: insight; +Cc: jmills, bgat

Hi Leon and everyone,

I've noticed some strange behavior with Insight similar to Leon's.  BTW,
my Insight is configured as "--host=i586-pc-cygwin --target=m68k-coff"
and is the 20000314 snapshot.

My problem:  If my target runs at full speed, I have no way to tell
Insight I want to break execution wherever it happens to be.  As soon as
I hit the continue button, Insight changes the cursor to an hourglass and
just hangs (if I don't have a breakpoint set that execution will hit).  I
can't do anything except kill gdb and restart it.  I want to press the
stop button but as Insight appears to be hung at this point, it doesn't
work.  This is *extremely* annoying; anyone have any idea why it does
this and what the solution/workaround might be?

Many thanks,
Scott


On Tue, 02 May 2000 19:34:35 +0300 Leon Pollak <leonp@plris.com> writes:
> Hello, gurus.
>     Please, can somebody describe rather strange behavior of Ctrl-C 
> that
> I have?
>     I run Insight from xterm and the program downloads to the target
> and starts to run.
>     When I press Ctrl-C in command window, press "STOP" button or 
> try to
> close Insignt - nothing happens.
>     Even the windows are not redrawn and remain blank if I minimize
> them.
>     But when I press Ctrl-C from the xterm window, Insignt says that 
> it
> received SGINT interrupt and stops the target.
> 
>     May thanks ahead.
> 
> leonp@plris.com
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Ctrl-C strange behavior
@ 2000-05-02 10:32 Leon Pollak
  2000-05-04  9:10 ` Keith Seitz
  0 siblings, 1 reply; 11+ messages in thread
From: Leon Pollak @ 2000-05-02 10:32 UTC (permalink / raw)
  To: Insight

Hello, gurus.
    Please, can somebody describe rather strange behavior of Ctrl-C that
I have?
    I run Insight from xterm and the program downloads to the target
and starts to run.
    When I press Ctrl-C in command window, press "STOP" button or try to
close Insignt - nothing happens.
    Even the windows are not redrawn and remain blank if I minimize
them.
    But when I press Ctrl-C from the xterm window, Insignt says that it
received SGINT interrupt and stops the target.

    May thanks ahead.

leonp@plris.com

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

end of thread, other threads:[~2000-05-22  9:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-16 11:08 Ctrl-C strange behavior Will Lentz
2000-05-22  7:58 ` Elena Zannoni
  -- strict thread matches above, loose matches on Subject: below --
2000-05-22  9:14 Will Lentz
2000-05-22  9:18 ` Elena Zannoni
2000-05-05 13:30 Scott A Sumner
2000-05-12 11:11 ` Elena Zannoni
2000-05-03 17:00 Scott A Sumner
2000-05-03 17:45 ` Chris Faylor
2000-05-04  8:58 ` Keith Seitz
2000-05-02 10:32 Leon Pollak
2000-05-04  9:10 ` 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).