This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/Linux] Ask kernel to kill inferior when GDB terminates
- From: Pedro Alves <palves at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>, gdb-patches at sourceware dot org
- Date: Fri, 14 Nov 2014 17:08:57 +0000
- Subject: Re: [RFA/Linux] Ask kernel to kill inferior when GDB terminates
- Authentication-results: sourceware.org; auth=none
- References: <1415984034-27122-1-git-send-email-brobecker at adacore dot com>
On 11/14/2014 04:53 PM, Joel Brobecker wrote:
> Hello,
>
> This patch enhances GDB on GNU/Linux systems to ask the kernel
> to kill the inferior if GDB terminates without doing it itself.
> This would typically happen when GDB encounters a problem and
> crashes, or when it gets killed by an external process. This can
> be observed by starting a program under GDB, and then killing
> GDB with signal 9. After GDB is killed, the inferior still remains
> in "interruptible sleep (waiting for an event to complete)" state.
I could see this making some sense when GDB has spawned the process,
but it seems harsh when GDB has attached to the process instead
of spawning it?
Note that Windows has had a similar feature for
ages (DebugSetProcessKillOnExit), and how windows-nat.c calls
DebugSetProcessKillOnExit(false) when GDB attaches to a process.
Thanks,
Pedro Alves