Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Colascione <dancol@dancol.org>
To: gdb-patches <gdb-patches@sourceware.org>
Subject: [RFC] [PATCH] Kill processes, not process groups
Date: Thu, 14 May 2015 07:59:00 -0000	[thread overview]
Message-ID: <555455E2.3060905@dancol.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]

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 <dancol@dancol.org>
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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

             reply	other threads:[~2015-05-14  7:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14  7:59 Daniel Colascione [this message]
2015-05-14  8:17 ` pinskia
2015-05-14  8:18   ` Daniel Colascione

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=555455E2.3060905@dancol.org \
    --to=dancol@dancol.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox