Index of /kdump2gdb/kdump2gdb-0.1
Name Last modified Size Description
Parent Directory 11-Oct-2006 23:52 -
COPYING 06-Oct-2006 17:50 18k
Makefile 06-Oct-2006 17:52 1k
gdbmacros 06-Oct-2006 17:52 4k
kdump2gdb 06-Oct-2006 17:52 2k
kdumpfix.c 06-Oct-2006 17:50 7k
kdump2gdb
---------
The kdump2gdb script converts a kdump core file (which is essentially an ELF
core) into a slightly different ELF core that can be directly used with gdb.
It also produces a gdb script that loads the required kernel modules.
Features:
- completely automated: run kdump2gdb, then start gdb on your new core file,
load modules, and enjoy!
- the power of gdb to explore stack frames with full debug infos
Limitations:
- currently limited to x86-64; but support for other arches should not be
difficult to add
- only running processes can be backtraced: it is certainly possible to
enable stack trace of all tasks, and I'd love to add this feature!
Give me some time to look into it.
- gdb scripting is *slow*! But a patch that improves this is already
available, and I suspect there could be more in the near future.
Sample session
--------------
Below is an example of how I use kdump2gdb (from the tarball). As you can see,
even on a 2GHz Athlon box with a patched gdb, it takes 5 minutes to complete.
$ cd kdump2gdb-0.1
$ make
gcc -Wall -g -lelf kdumpfix.c -o kdumpfix
$ \time ./kdump2gdb -k /var/dump/dump-2006-09-21_11\:15\:21i \
-d ../build-2.6.18/ -o /tmp/core -g modload
Restoring low identity-mapped areas...
Gathering vmalloc-mapped areas...
warning: shared library handler failed to enable breakpoint
Restoring vmalloc-mapped areas...
Preparing gdb script to map modules...
warning: shared library handler failed to enable breakpoint
All done. Now you can do:
$ gdb ../build-2.6.18//vmlinux /tmp/core
(gdb) source modload
(gdb) bt
203.21user 6.57system 5:07.01elapsed 68%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (37196major+1055938minor)pagefaults 0swaps
(The warnings are produced by gdb, they are harmless.)
Gdb patches
-----------
I use gdb 6.5, and encountered the following problems:
- gdb crashes in realloc on add-symbol-file:
the fix is here:
http://sources.redhat.com/ml/gdb-patches/2006-10/msg00056.html
- gdb scripts are sooooooooooo sloooooow:
a significant improvement is observed with the patch mentioned here:
http://sources.redhat.com/ml/gdb/2006-10/msg00023.html
You should edit the kdump2gdb script to use a specific gdb binary if needed.
Licensing
---------
This program is free software, distributed under the terms of the
GNU General Public License version 2.
Contact
-------
Jean-Marc Saffroy <saffroy@gmail.com>