linux kernel src (git clone from [email protected]:torvalds/linux.git)
qemu
cgdb
...
steps
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
cd debug_kernel && make dr
edit file gdbinit in first level and replacetarget 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