2016-09-29 75 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 –

相关问题