Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Roland Puntaier <Roland.Puntaier@br-automation.com>
To: gdb@sourceware.org
Subject: Re: gdb-6.6 mingw port hangs after Ctrl-C
Date: Fri, 24 Aug 2007 16:12:00 -0000	[thread overview]
Message-ID: <OF359AA647.60B6B3E8-ONC1257340.0052AC0E-C1257341.0058F273@br-automation.com> (raw)
In-Reply-To: <u8x83wf9b.fsf@gnu.org>

Thanks fo the hints.

Here is the kludge I hacked (added/changed lines are marked with 
ChCtrlCRemote):

--- gdb-6.6-mingw/gdb/ser-mingw.c       Tue Oct 10 16:23:11 2006
+++ ../gdb-6.6-mingw/gdb/ser-mingw.c    Fri Aug 24 10:37:07 2007
@@ -886,7 +886,7 @@
 
   while (1)
     {
-      HANDLE wait_events[2];
+      HANDLE wait_events[3];//ChCtrlCRemote: HANDLE wait_events[2];
       WSANETWORKEVENTS events;
 
       SetEvent (state->have_stopped);
@@ -901,8 +901,11 @@
 
       wait_events[0] = state->stop_select;
       wait_events[1] = state->sock_event;
+      wait_events[2] = state->exit_select;//ChCtrlCRemote
 
-      event_index = WaitForMultipleObjects (2, wait_events, FALSE, 
INFINITE);
+      event_index = WaitForMultipleObjects (3, wait_events, FALSE, 
INFINITE);//ChCtrlCRemote: event_index = WaitForMultipleObjects (2, 
wait_events, FALSE, INFINITE);
+      if (event_index-WAIT_OBJECT_0==2)//ChCtrlCRemote
+        return 0;//ChCtrlCRemote
 
       if (event_index == WAIT_OBJECT_0
          || WaitForSingleObject (state->stop_select, 0) == WAIT_OBJECT_0)
--- gdb-6.6-mingw/gdb/ser-base.c        Fri Feb 10 23:01:43 2006
+++ ../gdb-6.6-mingw/gdb/ser-base.c     Fri Aug 24 10:34:16 2007
@@ -178,6 +178,11 @@
   reschedule (scb);
 }
 
+extern HANDLE evt_stop_wait;//ChCtrlCRemote
+#include <exceptions.h>//ChCtrlCRemote
+#include <target.h>//ChCtrlCRemote
+#define DATA_BUFSIZE 4096//ChCtrlCRemote
+
 /* Wait for input on scb, with timeout seconds.  Returns 0 on success,
    otherwise SERIAL_TIMEOUT or SERIAL_ERROR. */
 
@@ -271,6 +276,13 @@
          status = SERIAL_TIMEOUT;
          break;
        }
+
+      if 
(WaitForSingleObject(evt_stop_wait,0)==WAIT_OBJECT_0)//ChCtrlCRemote
+      {//ChCtrlCRemote
+          target_mourn_inferior ();//ChCtrlCRemote
+          deprecated_throw_reason (RETURN_QUIT);//ChCtrlCRemote
+      }//ChCtrlCRemote
+ 
     }
 
   if (status < 0)
--- gdb-6.6-mingw/gdb/remote.c  Tue Nov 14 22:40:19 2006
+++ ../gdb-6.6-mingw/gdb/remote.c       Fri Aug 24 10:32:59 2007
 /* Ask the user what to do when an interrupt is received.  */
+#include <windows.h>//ChCtrlCRemote
+HANDLE evt_stop_wait=0;//ChCtrlCRemote
 
 static void
 interrupt_query (void)
@@ -2907,6 +2912,8 @@
   if (query ("Interrupted while waiting for the program.\n\
 Give up (and stop debugging it)? "))
     {
+      SetEvent(evt_stop_wait);//ChCtrlCRemote
+      return;//ChCtrlCRemote
       target_mourn_inferior ();
       deprecated_throw_reason (RETURN_QUIT);
     }
@@ -6144,6 +6151,8 @@
 void
 _initialize_remote (void)
 {
+  evt_stop_wait=CreateEvent(NULL,FALSE,FALSE,NULL);//ChCtrlCRemote
+
   struct remote_state *rs;
 
   /* architecture specific data */


  parent reply	other threads:[~2007-08-24 16:12 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-20 16:20 Roland Puntaier
2007-08-20 16:24 ` Daniel Jacobowitz
2007-08-20 19:16   ` Eli Zaretskii
2007-08-20 19:31     ` Daniel Jacobowitz
2007-08-21  2:56       ` Christopher Faylor
2007-08-21 17:42         ` Jim Blandy
2007-08-21 19:09           ` Eli Zaretskii
2007-08-21 23:47             ` Jim Blandy
2007-08-22  3:13               ` Eli Zaretskii
2007-08-22 10:13                 ` Dave Korn
2007-08-22 19:17                   ` Eli Zaretskii
2007-08-24  9:19                     ` Roland Puntaier
2007-08-24 16:12                     ` Roland Puntaier [this message]
2007-08-21 22:55           ` Christopher Faylor
2007-08-22 11:10         ` Roland Puntaier
2007-08-22 19:20           ` Eli Zaretskii
2007-08-23  2:49             ` 答复: (Rising Spam Alert)Re: " xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
2007-08-23  2:49             ` xchen
     [not found]             ` <NUTMEGt3HvoFOAmEaJs0000003d@mail.artimi.com>
2007-08-23  9:30               ` Dave Korn
2007-08-21  3:22       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF359AA647.60B6B3E8-ONC1257340.0052AC0E-C1257341.0058F273@br-automation.com \
    --to=roland.puntaier@br-automation.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox