From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@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 07:59:00 -0000 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 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Qh7Xg4rjd5SbpRJoRq73Nt8hUqgeNcEtf" X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00354.txt.bz2 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Qh7Xg4rjd5SbpRJoRq73Nt8hUqgeNcEtf Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 1171 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 --Qh7Xg4rjd5SbpRJoRq73Nt8hUqgeNcEtf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJVVFXiAAoJEN4WImmbpWBlOdwP/0ze/O2qvFFh2x8GcKOl03CD Qi2kT3R9OgonCPZH9Xo+Tck7VyFXU2FNe9vdqpshrJZ8TSU2jK7i4hY397ZCxyfL +CrYhIm17+Yism7Sy8dgnku+35z/4T8e2Ay0qEwWZyIF5Z4uf7PoYpDnOHBFSHIx AXs3RgPCYXcQJAcXUqc6bixCb+Vb/FWByCXaJSUvGWPSQ3UTdeJRGTRX011nqvxS Fj6Wxe2CQ+paacQWmkxYy9L9BVgqG/dvEjJEj+imv8kbz1ZSGdZ9RPcDiw6OI93F DCe1ptNOwXaUanvbSh5PmGEjDM+rSfSWnVZYg2RdXTmomtEcWdk9Ul9A19CI+qvW SmW95IUJUMcB0DkqWg5614lzBR8bRobLnimbNicv+/0ZCYeRL8JF372kevSVprkP YkfMhDjh+DSrjOlkWWLsdC8YeRQRsfZiv0rfVwSE2QKR78tanfwNiLbsmByjNpoq sQazr9xUlpXA7Njfo+MK9hb1gplae6oPwD8lmb6R+Lq+VLwOzsHyEGWFEMq92gUJ fIud/GmTLdxNO1nwm/CF2PVebKXl+Wic/CBMpA7yFuNyjQBHDIEytCfizuc+pzOY IUBht4rIeqQ/EEG2gugPDuae08oHuVPbJXL4qw3VNZQOv8LA8oo4YpD7JSmxxjIZ 7bAqvBRRMtipr0qdgEnC =D2Y5 -----END PGP SIGNATURE----- --Qh7Xg4rjd5SbpRJoRq73Nt8hUqgeNcEtf--