<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 1. Introduction</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.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><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" title="Chapter 1. Introduction"><div class="titlepage"><div><div><h2 class="title"><a id="Introduction"></a>Chapter 1. Introduction</h2></div></div></div><p>
    The kernel has two different debugger front ends (kdb and kgdb)
    which interface to the debug core.  It is possible to use either
    of the debugger front ends and dynamically transition between them
    if you configure the kernel properly at compile and runtime.
    </p><p>
    Kdb is simplistic shell-style interface which you can use on a
    system console with a keyboard or serial console.  You can use it
    to inspect memory, registers, process lists, dmesg, and even set
    breakpoints to stop in a certain location.  Kdb is not a source
    level debugger, although you can set breakpoints and execute some
    basic kernel run control.  Kdb is mainly aimed at doing some
    analysis to aid in development or diagnosing kernel problems.  You
    can access some symbols by name in kernel built-ins or in kernel
    modules if the code was built
    with <span class="symbol">CONFIG_KALLSYMS</span>.
    </p><p>
    Kgdb is intended to be used as a source level debugger for the
    Linux kernel. It is used along with gdb to debug a Linux kernel.
    The expectation is that gdb can be used to "break in" to the
    kernel to inspect memory, variables and look through call stack
    information similar to the way an application developer would use
    gdb to debug an application.  It is possible to place breakpoints
    in kernel code and perform some limited execution stepping.
    </p><p>
    Two machines are required for using kgdb. One of these machines is
    a development machine and the other is the target machine.  The
    kernel to be debugged runs on the target machine. The development
    machine runs an instance of gdb against the vmlinux file which
    contains the symbols (not boot image such as bzImage, zImage,
    uImage...).  In gdb the developer specifies the connection
    parameters and connects to kgdb.  The type of connection a
    developer makes with gdb depends on the availability of kgdb I/O
    modules compiled as built-ins or loadable kernel modules in the test
    machine's kernel.
    </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>
