2016-09-29 74 views

回答

1

通過向qemu comman行提供-s,您可以啓動qemu,並使用gdb服務器偵聽端口1234。從QEMU手冊頁:

-s Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 
     1234. 

在additon這一點,你也可以直到你GDB連接到它併發出命令continue使用選項-S將從進展停止的Qemu。

-S Do not start CPU at startup (you must type 'c' in the monitor). 

從GDB,您連接到GDB服務器上運行QEMU,通過啓動GDB(GDB適合你客人架構的版本)。然後通過命令連接到GDB服務器(如果QEMU是在同一臺機器上運行的):

(gdb) target remote :1234

參考文獻:

  1. http://wiki.qemu.org/Documentation/Debugging
  2. How to debug the Linux kernel with GDB and QEMU?
+0

這裏是一個更詳細的QEMU GDB設置教程:https://stackoverflow.com/a/33203642/895245 –

相關問題