[RFA/Linux] Ask kernel to kill inferior when GDB terminates

Pedro Alves palves@redhat.com
Fri Nov 14 17:09:00 GMT 2014


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



More information about the Gdb-patches mailing list