- A linux kernel debug env based on qemu and gdb
- linux kernel src (git clone from git@github.com:torvalds/linux.git)
- qemu
- cgdb
- ...
- download linux kernel src and compile it to vmlinux (with debug_info and no any install)
- pull debug_kernel and put it in the first level of linux kernel src code
cd debug_kernel
&&make mad
(details are in Makefile)- gen manual
ramdisk.img
including busybox with the most basic linux cmd
- gen manual
cd debug_kernel
&&make dr
- edit file gdbinit in first level and replace
target remote:1236
of yours- 1236 is the gdbserver listen port, corresponding to the port you specify in Makefile
- cgdb -q -x gdbinit
- More details are in Makefile, you can choose kinds of blocks (ahci disk, nemv ssd, nvdimm, etc.) to debug corresponding driver and all parts in kernel, you can gen backend storage file by Makefile
- debug kernel without block dev
- debug kernel with a ahci disk device in
/dev
- debug nvdimm with a nvdimm device in
/dev
- debug nvme ssd with a nvme ssd device in
/dev
- debug pcie hba by vfio