From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30534 invoked by alias); 24 Aug 2007 16:12:05 -0000 Received: (qmail 30336 invoked by uid 22791); 24 Aug 2007 16:11:58 -0000 X-Spam-Check-By: sourceware.org Received: from mail.br-automation.com (HELO mail1.br-automation.com) (213.33.116.60) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 24 Aug 2007 16:11:51 +0000 X-AuditID: c0a80109-a77e7bb000000913-fe-46cf033ab33d Received: from brsmtp01.br-automation.com (unknown [192.168.1.60]) by mail1.br-automation.com (Symantec Mail Security) with ESMTP id C88F9420002 for ; Fri, 24 Aug 2007 18:11:38 +0200 (CEST) In-Reply-To: MIME-Version: 1.0 Reply-By: Expiry-Date: Reply-To: To: gdb@sourceware.org Subject: Re: gdb-6.6 mingw port hangs after Ctrl-C X-Mailer: Lotus Notes Release 7.0.2 September 26, 2006 Message-ID: From: Roland Puntaier Date: Fri, 24 Aug 2007 16:12:00 -0000 Content-Type: text/plain; charset="US-ASCII" X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00191.txt.bz2 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 //ChCtrlCRemote +#include //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 //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 */