Supported on windows
Supported on linux
Not supported on embedded
Supported on android

kill command

Forcibly terminates the debugged process

Syntax

kill

Examples

In the following example we attach GDB to a running Linux process and terminate it via GDB:

(gdb) attach 14199
Attaching to process 14199
Reading symbols from /home/testuser/0.elf...done.
Reading symbols from /lib/i386-linux-gnu/libc.so.6...Reading symbols from /usr/lib/debug/lib/i386-linux-gnu/libc-2.15.so...done.
done.
Loaded symbols for /lib/i386-linux-gnu/libc.so.6
Reading symbols from /lib/ld-linux.so.2...Reading symbols from /usr/lib/debug/lib/i386-linux-gnu/ld-2.15.so...done.
done.
Loaded symbols for /lib/ld-linux.so.2
0xb771f424 in __kernel_vsyscall ()
(gdb) kill
Kill the program being debugged? (y or n) y
(gdb)

Compatibility with VisualGDB

Do not execute the kill command manually under Visual Studio. Use the VisualGDB Project Properties dialog to configure VisualGDB to execute the kill command when you exit debugging with Shift-F5.

See also