From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109599 invoked by alias); 26 Jan 2016 14:13:14 -0000 Mailing-List: contact gdb-testers-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-testers-owner@sourceware.org Received: (qmail 109580 invoked by uid 89); 26 Jan 2016 14:13:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 spammy= X-HELO: kwanyin.sergiodj.net Received: from kwanyin.sergiodj.net (HELO kwanyin.sergiodj.net) (176.31.208.32) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 26 Jan 2016 14:13:12 +0000 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] [GDBserver] Block and unblock SIGIO From: sergiodj+buildbot@redhat.com To: gdb-testers@sourceware.org Message-Id: <8b2073398477b33d425b0570236fe4e4222fe2c4@gdb-build> Date: Tue, 26 Jan 2016 14:13:00 -0000 X-SW-Source: 2016-q1/txt/msg03426.txt.bz2 *** TEST RESULTS FOR COMMIT 8b2073398477b33d425b0570236fe4e4222fe2c4 *** Author: Yao Qi Branch: master Commit: 8b2073398477b33d425b0570236fe4e4222fe2c4 [GDBserver] Block and unblock SIGIO Nowadays, GDBserver disables async io (by ignoring SIGIO) when process a serial event, and enables async io (by installing signal handler) when resume the inferior and wait. GDBserver may miss SIGIO (by interrupt) and doesn't process SIGIO in time, which is shown by gdb.base/interrupt-noterm.exp. In the test, GDB sends "continue &" and then "interrupt". if '\003' arrives at a period between GDBserver receives vCont;c and enables async io, SIGIO is ignored because signal handler isn't installed. GDBserver waits for the inferior and can not notice '\003' until it returns from wait. This patch changes the code to install SIGIO handler early, but block and unblock SIGIO as needed. In this way, we don't remove SIGIO handler, so SIGIO can't be ignored. However, GDBserver needs to remove the signal handler when connection is closed. gdb/gdbserver: 2016-01-26 Yao Qi * remote-utils.c (remote_close) [!USE_WIN32API]: Ignore SIGIO. (unblock_async_io): Rename to ... (block_unblock_async_io): ... it. New function. (enable_async_io): Don't install SIGIO handler. Unblock it instead. (disable_async_io): Don't ignore SIGIO. Block it instead. (initialize_async_io): Install SIGIO handler. Don't call unblock_async_io.