Debug a Linux Kernel in QEMU

mkinitramfs -o ../ramdisk.img 5.11.0-34-generic
qemu-system-x86_64 -kernel arch/x86_64/boot/bzImage \
    -initrd ../ramdisk.img -m 1024 -s -S \
    -append "console=ttyS0 nokaslr" -nographic
gdb vmlinux
target remote:1234
hb start_kernel

linux (9) kernel (5) qemu (1)