Subject: [PATCH 00/13] Add gdb python scripts as kernel debugging helpers
Date: Wednesday 3rd October 2012 11:21:31 UTC (over 5 years ago)
I'm sitting too long on this stuff, time to finally role it out: This adds the infrastructure and first tools that make kernel debugging through gdb more comfortable. Since 7.0, gdb supports python scripting. And this opens the doors to automate steps like the tedious loading of module symbols at the right address, resolving per-cpu variables or even retrieving the current kernel log without resuming an stopped target. Many of the helpers naturally depend on the layout of structures or internal mechanics of the kernel. So the best place to maintain such things, keeping them consistent with the corresponding kernel is, well, the kernel itself. While these scripts have been originally developed for debugging via QEMU/KVM, I've now also added the required bits for KGDB. Works fine, but as QEMU/KVM tends to outperform KGDB it remains the recommendation - when available. There are two architecture dependencies so far, one regarding per-cpu, the other regarding thread_info calculation. None of them I was able to test on a target, so I'm counting on review/testing by the corresponding communities. This series should be considered the foundation of much more kernel state exploration helper, e.g. around tasks, timers, locks, sockets - I guess people will have even more ideas. Hope it's useful! PS: Also available via git://git.kiszka.org/linux.git queues/gdb-scripts CC: "David S. Miller"