From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22016 invoked by alias); 27 Feb 2008 20:09:11 -0000 Received: (qmail 22008 invoked by uid 22791); 27 Feb 2008 20:09:10 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Feb 2008 20:08:53 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A3D392AAAEB for ; Wed, 27 Feb 2008 15:08:51 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lJIh1EC20Zp7 for ; Wed, 27 Feb 2008 15:08:51 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 681252AAAD0 for ; Wed, 27 Feb 2008 15:08:51 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id DD8AFE7ACB; Wed, 27 Feb 2008 12:08:48 -0800 (PST) Date: Wed, 27 Feb 2008 20:23:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [RFC] Avoid some crashes at SIGINT Message-ID: <20080227200848.GA3701@adacore.com> References: <20080227025444.GA22935@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080227025444.GA22935@caradoc.them.org> User-Agent: Mutt/1.4.2.2i 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: 2008-02/txt/msg00448.txt.bz2 > The new interface is gdb_call_async_signal_handler. SIGINT handlers, > when running in non-async mode or otherwise wanting an "immediate" > reaction, can call this and pass it the async handler's token instead > of duplicating the async handler's code. Then for POSIX platforms > the function is called immediately and for Windows it is deferred > to gdb_select. The event loop always uses gdb_select and so do > the remote targets which had SIGINT handlers. This is pretty clever. I also looked at the patch, and it looked sensible to me. But I admit that I'm not completely familiar with this part of the code. > Some day, we may want to use the same mechanism that I've added here > for POSIX platforms too. That will close the race conditions of where > we are when the signal arrives. That requires async GDB; Vladimir has > been looking at Nick's and Apple's patches for this again. For now, > I left the POSIX platform behavior unchanged. I look forward to this. -- Joel