Difference between revisions of "Debugging The Linux Kernel Using Gdb"

From eLinux.org
Jump to: navigation, search
m
m
Line 3: Line 3:
 
The majority of day to day kernel debugging is done by adding print statements to code by using the famous printk function. Using printk it as it is relatively simple and effective and cheap technique to use. There are many other linux grown techniques that take the debugging and profiling approach to a higher level. On this page we will discuss using the gnu debugger to do kernel debugging. Overall starting using gdb to do kernel debugging is relatively easy.
 
The majority of day to day kernel debugging is done by adding print statements to code by using the famous printk function. Using printk it as it is relatively simple and effective and cheap technique to use. There are many other linux grown techniques that take the debugging and profiling approach to a higher level. On this page we will discuss using the gnu debugger to do kernel debugging. Overall starting using gdb to do kernel debugging is relatively easy.
  
Most of the examples here will work in two (open source) situations. when using jtag and when using qemu system emulation.
+
Most of the examples here will work in two (open source) situations. when using JTAG and when using qemu system emulation. As the second option does not require any hardware you could go on and try it right away!
As the second option does not require any hardware you could go on and try it right away!
+
 
 +
The open source jtag debugging world is not that big. One project stands out in terms of debugging capabilities is OpenOCD and this is the tool used in this documentation.
 +
 
 +
=== vmlinuz zImage and CO ===
 +
 
 +
=== Loading a kernel in memory ===
 +
 
 +
=== Getting the kernel log buffer ===
 +
 
 +
=== Debugging a kernel module (.o and .ko ) ===

Revision as of 17:34, 25 November 2008

Debugging the linux kernels using gdb

The majority of day to day kernel debugging is done by adding print statements to code by using the famous printk function. Using printk it as it is relatively simple and effective and cheap technique to use. There are many other linux grown techniques that take the debugging and profiling approach to a higher level. On this page we will discuss using the gnu debugger to do kernel debugging. Overall starting using gdb to do kernel debugging is relatively easy.

Most of the examples here will work in two (open source) situations. when using JTAG and when using qemu system emulation. As the second option does not require any hardware you could go on and try it right away!

The open source jtag debugging world is not that big. One project stands out in terms of debugging capabilities is OpenOCD and this is the tool used in this documentation.

vmlinuz zImage and CO

Loading a kernel in memory

Getting the kernel log buffer

Debugging a kernel module (.o and .ko )