From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28781 invoked by alias); 26 Nov 2009 22:28:50 -0000 Received: (qmail 28773 invoked by uid 22791); 26 Nov 2009 22:28:50 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Nov 2009 22:28:05 +0000 Received: (qmail 10322 invoked from network); 26 Nov 2009 22:28:03 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 26 Nov 2009 22:28:03 -0000 From: Pedro Alves To: "gdb-patches@sourceware.org" Subject: gdbserver/win32, fix ctrl-c handling. Date: Thu, 26 Nov 2009 22:28:00 -0000 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200911262228.04610.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-11/txt/msg00576.txt.bz2 Sometimes, a win32 gdbserver would ignore a ctrl-c, because this remote-utils.c:input_interrupt: if (cc != 1 || c != '\003' || current_inferior == NULL) { fprintf (stderr, "input_interrupt, count = %d c = %d ('%c')\n", cc, c, c); return; } was being reached with current_inferior == NULL. current_inferior ends up set to NULL after a EXIT_THREAD_DEBUG_EVENT event. Between a thread exit event and any other event that forced a curren_inferiot switch, ctrl-c's where ignored. I've applied this patch to handle it like linux-low.c does. When a thread exits, switch to any thread other thread (always the first in the thread list, just because it's simple and handy). -- Pedro Alves