1
我想知道如何使用QEMU和gdb調試Linux內核。我在我的虛擬機中編譯了新的內核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」,一切都很好,直到現在。但是,當我繼續輸入「目標遠程本地主機:1234」。它打印一些奇怪的消息。像這樣如何使用QEMUn和GDB調試內核
(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'。它會顯示「程序沒有運行」。我好幾天一直困惑於這個問題。任何人都可以幫助我解決它並讓程序運行。非常感謝。
這個問題有類似的錯誤報告:https://sourceware.org/bugzilla/show_bug.cgi?id = 13984。您可以嘗試應用附加到錯誤報告的修補程序並重新構建gdb。 – ks1322
非常感謝。這個對我有用 ! – Jerry