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
Technical requirements
With a few additions (which follow), ...
Get Linux Kernel Debugging now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.