This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] [GDBServer] Send SIGINT using process group ID
- From: Pedro Alves <palves at redhat dot com>
- To: Jim Chen <nchen at mozilla dot com>, gdb-patches at sourceware dot org
- Date: Wed, 18 May 2016 13:10:27 +0100
- Subject: Re: [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> <1463003507-13094-2-git-send-email-nchen at mozilla dot com>
On 05/11/2016 10:51 PM, Jim Chen wrote:
> 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.
Can you expand on the use case you see this happening on, please?
I can imagine some, but I'd like to hear it from you.
Some have expressed desire to _not_ send the SIGINT to the whole
process group, which may make sense when you're attached to a
process rather than having started it. IIRC, there's a bug filed in
bugzilla about this.
Looking at the code, not-sending-to-process-group-when-attached
is what native GNU/Linux does too (inflow.c:pass_signal).
Seems like "c&" -> "interrupt" doesn't consider "attach" either,
as inf-ptrace.c:inf_ptrace_interrupt sends the SIGINT
to the process, and like gdbserver, assumes the inferior's
PID is the process group id.
Thanks,
Pedro Alves