我想知道如何使用QEMU和gdb调试linux内核。我在我的VM中编译了新的内核linux-3.18.6。我的VM环境是centos,内核版本是3.10.0-327.el7.x86_64。我使用命令“qemu-system-x86_64 -kernel /usr/src/linux-3.18.6/arch/x86/boot/bzImage -initrd rootfs.img -s -S”来运行新内核。然后,我使用另一个shell窗口来运行“gdb ./vmlinux”,到目前为止一切都很好。但是,当我继续输入“target remote localhost:1234”时。它打印出一些奇怪的消息。就像这个
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
Remote 'g' packet reply is too long:
00000000000000000000000000000000000000000000000063060000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000f0ff0000000000000200000000f0000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000007f0300000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000801f0000
(gdb) c
The program is not being run.
然后,当我输入'c'时。它将显示“程序未运行。”。我好几天都对这个问题感到困惑。任何人都可以帮我修复它并让程序运行。非常感谢。