# KGDB

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/KGDB
> Markdown URL: https://mediated.wiki/source/KGDB.md
> Source: https://en.wikipedia.org/wiki/KGDB
> Source revision: 1322512684
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{for|the airport with the ICAO airport code|Granite Falls Municipal Airport}}
{{Primary sources|date=June 2010}}
{{Infobox software
|name                   = KGDB
|logo                   =
|author                 = Dave Grothe
|developer              = Jason Wessel
|released               =
|latest release version =
|latest release date    =
|latest preview version =
|latest preview date    =
|programming language   =
|operating system       = [Linux](/source/Linux)
|platform               =
|size                   =
|status                 =
|genre                  = [Debugger](/source/Debugger)
|license                = [GNU General Public License](/source/GNU_General_Public_License)
|website                = [https://kgdb.wiki.kernel.org kgdb.wiki.kernel.org]
}}
{{Portal|Free and open-source software}}
'''KGDB''' is a [debugger](/source/debugger) for the [Linux kernel](/source/Linux_kernel) and the kernels of [NetBSD](/source/NetBSD) and [FreeBSD](/source/FreeBSD). It requires two machines that are connected via a serial connection. The serial connection may either be an [RS-232](/source/RS-232) interface using a [null modem](/source/null_modem) cable, or via the [UDP](/source/User_Datagram_Protocol)/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](/source/GNU_Debugger). The GDB remote protocol is used between the two machines.

KGDB was implemented as part of the NetBSD kernel in 1997,<ref>{{cite web|title=Commit adding KGDB to NetBSD kernel|url=http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/i386/conf/GENERIC.diff?r1=1.89&r2=1.90&only_with_tag=MAIN&f=h|work=NetBSD CVS source code|publisher=The NetBSD Foundation|accessdate=1 August 2013}}</ref> and FreeBSD in version 2.2. The concept and existing remote gdb protocol were later adapted as a [patch](/source/Patch_(computing)) 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](/source/IA-32), [x86-64](/source/x86-64), [PowerPC](/source/PowerPC), [ARM](/source/ARM_architecture), [MIPS](/source/MIPS_architecture), and [ESA/390](/source/IBM_ESA%2F390). 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.<ref>{{cite web |url=http://kgdb.geeksofpune.in/credits.ht |title=KGDB: Linux Kernel Source Level Debugger |url-status=dead |archive-url=https://web.archive.org/web/20141015042943/http://kgdb.geeksofpune.in/credits.htm |archive-date=2014-10-15}}</ref><ref>{{cite web |url=https://lkml.org/lkml/2000/10/16/94 |title = LKML: "Amit S. Kale": kgdb (kernel debugger) updates}}</ref> 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](/source/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.<ref>{{cite web |url=http://kerneltrap.org/Linux/Kgdb_Light |title=Kgdb Light |website=KernelTrap |url-status=deviated |archive-url=https://web.archive.org/web/20080416041302/http://kerneltrap.org/Linux/Kgdb_Light |archive-date=2008-04-16}}</ref> 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](/source/FreeBSD). It is a gdb based utility for debugging kernel core files.<ref>{{cite web |url=http://www.freebsd.org/cgi/man.cgi?query=kgdb&sektion=1&manpath=FreeBSD+6.0-stable |title=FreeBSD kgdb man page}}</ref> 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.<ref>{{cite web |url=https://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug-online-gdb.html |title=FreeBSD handbook: remote KGDB}}</ref>

==References==
{{Reflist}}

==External links==
* [https://www.netbsd.org/docs/kernel/kgdb.html Debugging the NetBSD kernel with GDB HOWTO]
* [https://kgdb.wiki.kernel.org/ KGDB and KDB wiki, the official home of kgdb and kdb for kernel.org]
* [http://linsyssoft.com/product_kgdb.php 2.5 & up to 2.6.15 Linux Kernel Source Level Debugger]
* [http://www.freebsd.org/cgi/man.cgi?query=kgdb&apropos=0&sektion=0&manpath=FreeBSD+6.1-RELEASE&format=html FreeBSD kgdb manual]
* [https://sourceforge.net/projects/kgdb/ kgdb] at SourceForge.net

{{Linux}}

{{DEFAULTSORT:Kgdb}}
Category:Debuggers
Category:Third-party Linux kernel modules

{{programming-software-stub}}

---
Adapted from the Wikipedia article [KGDB](https://en.wikipedia.org/wiki/KGDB) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/KGDB?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
