1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter 1. Introduction</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Using kgdb, kdb and the kernel debugger internals"><link rel="up" href="index.html" title="Using kgdb, kdb and the kernel debugger internals"><link rel="prev" href="index.html" title="Using kgdb, kdb and the kernel debugger internals"><link rel="next" href="CompilingAKernel.html" title="Chapter 2. Compiling a kernel"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Introduction</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="CompilingAKernel.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="Introduction"></a>Chapter 1. Introduction</h1></div></div></div><p> 2 The kernel has two different debugger front ends (kdb and kgdb) 3 which interface to the debug core. It is possible to use either 4 of the debugger front ends and dynamically transition between them 5 if you configure the kernel properly at compile and runtime. 6 </p><p> 7 Kdb is simplistic shell-style interface which you can use on a 8 system console with a keyboard or serial console. You can use it 9 to inspect memory, registers, process lists, dmesg, and even set 10 breakpoints to stop in a certain location. Kdb is not a source 11 level debugger, although you can set breakpoints and execute some 12 basic kernel run control. Kdb is mainly aimed at doing some 13 analysis to aid in development or diagnosing kernel problems. You 14 can access some symbols by name in kernel built-ins or in kernel 15 modules if the code was built 16 with <span class="symbol">CONFIG_KALLSYMS</span>. 17 </p><p> 18 Kgdb is intended to be used as a source level debugger for the 19 Linux kernel. It is used along with gdb to debug a Linux kernel. 20 The expectation is that gdb can be used to "break in" to the 21 kernel to inspect memory, variables and look through call stack 22 information similar to the way an application developer would use 23 gdb to debug an application. It is possible to place breakpoints 24 in kernel code and perform some limited execution stepping. 25 </p><p> 26 Two machines are required for using kgdb. One of these machines is 27 a development machine and the other is the target machine. The 28 kernel to be debugged runs on the target machine. The development 29 machine runs an instance of gdb against the vmlinux file which 30 contains the symbols (not a boot image such as bzImage, zImage, 31 uImage...). In gdb the developer specifies the connection 32 parameters and connects to kgdb. The type of connection a 33 developer makes with gdb depends on the availability of kgdb I/O 34 modules compiled as built-ins or loadable kernel modules in the test 35 machine's kernel. 36 </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="CompilingAKernel.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Using kgdb, kdb and the kernel debugger internals </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. Compiling a kernel</td></tr></table></div></body></html> 37