Saturday, October 1, 2011

loading kernel in gdb

compile kernel with everything about tracing and kernel hacking (DYNAMIC, FTRACE, OPTIMIZE)

then vmlinux file is copied from remote to host

now start gdb/ddd
    > file vmlinux
    > target remote /dev/pts/X

that's it

Sysrq
echo g > /proc/sysrq-trigger
 
enable/disable sysrq
echo 0 > /proc/sys/kernel/sysrq
echo 1 > /proc/sys/kernel/sysrq 

Finding a symbol
grep alloc_pages /proc/kallsyms -- more symbols because of the loadable modules
or grep alloc_pages /boot/System.map-XXX -- only built-in symbols


kgdb ref:
http://elinux.org/Debugging_The_Linux_Kernel_Using_Gdb

No comments:

Post a Comment