2002 Linux Symposium
navigation



related

contact:

Using KGDB

George Anzinger

KGDB stands for the Kernel Gnu DeBugger. It uses gdb to debug kernels.

This tutorial is not about the KGDB on sourceforge, but the one that Andrew Morton has on his site.

Some years ago I picked up a copy of KGDB for the i386 arch. It fell on its face as I tried to do some kernel debugging so I started modifying it. Over the years I have made several improvements to both its robustness and to its capability. In this tutorial I intend to discuss what these mean and how to use them. A short list includes:

  • The kgdb_info structure, a way to get more info from kgdb AND to talk back.
  • Calling kernel functions from gdb/kgdb.
  • Calling kgdb as the first line of C in the kernel.
  • Kgdb time stamps, what (and why) they are and how to use them.
  • When the going gets tough: manual stack tracing.
  • SMP debugging, holding CPUs, automatic and manual.
  • Gdb/kgdb as the system console.

    This tutorial will give the kernel debugger enough information and help to set up a KGDB environment and to start doing meaningful debugging.

  • 2004
    © 1999-2003 Linux Symposium.  All Rights Reserved.