This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] [GDBServer] Send SIGINT using process group ID
- From: Jim Chen <nchen at mozilla dot com>
- To: gdb-patches at sourceware dot org
- Cc: Jim Chen <nchen at mozilla dot com>
- Date: Wed, 11 May 2016 17:51:47 -0400
- Subject: [PATCH] [GDBServer] Send SIGINT using process group ID
- Authentication-results: sourceware.org; auth=none
- References: <1463003507-13094-1-git-send-email-nchen at mozilla dot com>
Hi,
linux_request_interrupt is supposed to send SIGINT to the process group,
but it passes the process ID to kill() instead of the process group ID,
which may not be the same as the process ID. The patch calls getpgid
first to get the process group ID.
Patch tested on arm-linux.
gdb/gdbserver:
2016-05-11 Jim Chen <nchen@mozilla.com>
* linux-low.c (linux_request_interrupt): Use process group ID for
sending SIGINT
---
gdb/gdbserver/linux-low.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 8e1e2fc..a282ca1 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -5745,17 +5745,17 @@ linux_look_up_symbols (void)
static void
linux_request_interrupt (void)
{
extern unsigned long signal_pid;
/* 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 (-getpgid(signal_pid), SIGINT);
}
/* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET
to debugger memory starting at MYADDR. */
static int
linux_read_auxv (CORE_ADDR offset, unsigned char *myaddr, unsigned int len)
{
--
2.7.3