KGDB is a
debugger
A debugger is a computer program used to test and debug other programs (the "target" programs). Common features of debuggers include the ability to run or halt the target program using breakpoints, step through code line by line, and display ...
for the
Linux kernel
The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
and the kernels of
NetBSD
NetBSD is a free and open-source Unix-like operating system based on the Berkeley Software Distribution (BSD). It was the first open-source BSD descendant officially released after 386BSD was fork (software development), forked. It continues to ...
and
FreeBSD
FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
. It requires two machines that are connected via a serial connection. The serial connection may either be an
RS-232 interface using a
null modem cable, or via the
UDP/IP networking protocol (KGDB over Ethernet, KGDBoE). The target machine (the one being debugged) runs the patched kernel and the other (host) machine runs
gdb. The GDB remote protocol is used between the two machines.
KGDB was implemented as part of the NetBSD kernel in 1997, and FreeBSD in version 2.2. The concept and existing remote gdb protocol were later adapted as a
patch to the Linux kernel. A scaled-down version of the Linux patch was integrated into the official Linux kernel in version 2.6.26.
KGDB is available for the following architectures under Linux:
IA-32
IA-32 (short for "Intel Architecture, 32-bit", commonly called ''i386'') is the 32-bit version of the x86 instruction set architecture, designed by Intel and first implemented in the i386, 80386 microprocessor in 1985. IA-32 is the first incarn ...
,
x86-64
x86-64 (also known as x64, x86_64, AMD64, and Intel 64) is a 64-bit extension of the x86 instruction set architecture, instruction set. It was announced in 1999 and first available in the AMD Opteron family in 2003. It introduces two new ope ...
,
PowerPC
PowerPC (with the backronym Performance Optimization With Enhanced RISC – Performance Computing, sometimes abbreviated as PPC) is a reduced instruction set computer (RISC) instruction set architecture (ISA) created by the 1991 Apple Inc., App ...
,
ARM,
MIPS, and
ESA/390
IBM Enterprise Systems Architecture is an instruction set architecture introduced by IBM as Enterprise Systems Architecture/370 (ESA/370) in 1988. It is based on the IBM System/370-XA architecture.
It extended the dual-address-space mechanis ...
. It is available on all supported architectures of NetBSD and FreeBSD using only RS-232 connectivity.
Amit Kale maintained the Linux KGDB from 2000 to 2004. From 2004 to 2006, it was maintained by Linsyssoft Technologies, after which Jason Wessel at Wind River Systems, Inc. took over as the official maintainer.
Ingo Molnar and Jason Wessel created a slimmed-down and cleaned up version of KGDB which was called "kgdb light" (without Ethernet support and many other hacks). This was the one merged into the 2.6.26 kernel. This version of kgdb supports only RS-232 connectivity, using a special driver which can split debugger inputs and console inputs such that only a single serial port is required.
FreeBSD
A program named kgdb is also used by
FreeBSD
FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
. It is a gdb based utility for debugging kernel core files. It can also be used for remote "live" kernel debugging, much in the same way as the Linux KGDB, over either a serial connection or a firewire link.
FreeBSD handbook: remote KGDB
/ref>
References
External links
KGDB and KDB wiki, the official home of kgdb and kdb for kernel.org
2.5 & up to 2.6.15 Linux Kernel Source Level Debugger
FreeBSD kgdb manual
kgdb
at SourceForge.net
Debuggers
Third-party Linux kernel modules
{{programming-software-stub