Crash, the Linux kernel core dump debugger, has the ability to use extensions written in C, but oftentimes we want to do some automatic analysis or a dump of data that is more involved than what Crash offers natively. Since GDB 7.0, GDB has incorporated an embedded python interpreter.
Since we started hacking on this project during Hack Week several years ago, we've made significant progress in making crash-python more usable. The initial plan of exporting crash functionality via Python was ultimately discarded in favor of writing a kernel debugger in Python with as few GDB extensions as possible. The GDB extensions have long since been written and are entirely generic. We export some ELF functionality as well as add the ability to implement a GDB Target in Python.
As of the last Hack Week, the target has been implemented and interfaces with Petr Tesarik's libkdumpfile python module. The crash-python project uses that to offer some basic kernel debugging functionality: We can do 'dmesg', 'sys', and subsets of 'ps' and 'kmem.' We can also load up the tasks from the crash dump as GDB threads and do full symbolic debugging (with the caveat that the kernel is built with -O2 and some symbols are optimized away.) Some colleagues have used it to hunt real bugs in the course of their normal work!
This Hack Week, I'd like to continue to implement the full functionality of the original crash tool in Python with the end goal of being able to replace crash itself.
Latest links: <li><a href="https://build.opensuse.org/project/show/home![add-emoji](https://assets-cdn.github.com/images/icons/emoji/jeff_mahoney.png)crash-python">crash-python OBS Project</a> - Contains packages for libkdumpfile and our extended GDB without having to build them manually. <li><a href="https://github.com/jeffmahoney/crash-python/tree/crash-wip">crash-python GitHub Project (WIP branch)</a> - Contains the latest Python code <li><a href="https://etherpad.nue.suse.com/p/crash-todo">Etherpad for Crash TODO list</a>
Looking for mad skills in:
Nothing? Add some keywords!
This project is part of:
Hack Week 11 Hack Week 12 Hack Week 13 Hack Week 14 Hack Week 15 Hack Week 16 Hack Week 17
This project is one of its kind!