From patchwork Thu May 14 07:59:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Colascione X-Patchwork-Id: 6723 Received: (qmail 56460 invoked by alias); 14 May 2015 07:59:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 56445 invoked by uid 89); 14 May 2015 07:59:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: dancol.org Received: from dancol.org (HELO dancol.org) (96.126.100.184) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 14 May 2015 07:59:34 +0000 Received: from [2601:8:b201:2c26::2b1] by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84) (envelope-from ) id 1Yso3I-00005r-5l for gdb-patches@sourceware.org; Thu, 14 May 2015 00:59:32 -0700 Message-ID: <555455E2.3060905@dancol.org> Date: Thu, 14 May 2015 00:59:30 -0700 From: Daniel Colascione User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: gdb-patches Subject: [RFC] [PATCH] Kill processes, not process groups X-IsSubscribed: yes Killing process groups for interruption doesn't make any sense. Say we have a two-process group [A B], where A is the leader. If we attach to A and use "interrupt", we accidentally kill B. If we attach to B, "interrupt" does nothing. Why wouldn't we just signal A? This problem is worse in the gdbserver case. Locally, we use pass_signal, not interrupt, for C-c, and pass_signal does the right thing. But in the remote case, we have nothing but interrupt, and that doesn't seem to do users intend. commit 8d096e713e46f00bc8bf55743288a24f6222021f Author: Daniel Colascione Date: Wed May 13 23:58:24 2015 -0700 Kill the process we're dealing with, not the whole group diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 4da11c6..8a725fa 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -4904,7 +4904,7 @@ linux_request_interrupt (void) /* Send a SIGINT to the process group. This acts just like the user typed a ^C on the controlling terminal. */ - kill (-signal_pid, SIGINT); + kill (signal_pid, SIGINT); } /* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET