Chapter 11: Using Kernel GDB (KGDB)
What if we could set breakpoints (even hardware break/watchpoints) on the kernel's or a module's code, single-stepping through it, viewing variables, and examining memory, as we easily do for application-space processes with the really well-known debugger GNU Debugger (GDB)? Well, that's exactly what Kernel GDB (KGDB) allows – it's a source-level debug tool for the Linux kernel (and modules)!
In this chapter, we're going to cover the following main topics:
- Conceptually understanding how KGDB works
- Setting up an ARM target system and kernel for KGDB
- Debugging the kernel with KGDB
- Debugging kernel modules with KGDB
- [K]GDB – a few tips and tricks