使用gdb服务器和客户端的远程调试无法工作



我正在尝试使用运行在Linux内核2.6.38.8版本的ARM目标上的gdbserver进行远程调试。

在这个目标上,我运行了一个gdbserver,它是一个32位ELF文件,如下所示:

./gdbserver --remote-debug --attach 192.xxx.xxx.2:2345 1600
Attached; pid = 1600
Listening on port 2345

gdb服务器启动时说:

该gdbserver被配置为"arm none-linux-gnueabi"

在Ubuntu(32位)机器上,我运行GDB客户端,它看起来也32位(/usr/bin/GDB),如下所示,以连接到远程GDB服务器。在GDB提示下,我输入如下:

(gdb) **target remote 192.xxx.xxx.2:2345**
Remote debugging using 192.xxx.xxx.2:2345
**warning: Architecture rejected target-supplied description**

以下是我在客户端的GDB提示符上看到的错误:

Remote 'g' packet reply is too long: fcfdffff901bdbbe84d00e4002000000000000000000000000000100a2000000901bdbbe0000000000a006400000000000000000f819dbbe34bd3a4044bd3a40100000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008c4200b808422200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000
(gdb)

发出此命令后,我在目标gdbserver上看到以下错误:

Remote debugging from host 192.xxx.xxx.28
**readchar: Got EOF**
Remote side has terminated connection.  GDBserver will reopen the connection.

客户gdb说:

This GDB was configured as "**i686-linux-gnu**".

注意:还尝试使用--target-debug选项在目标上运行gdbserver,但仍然不起作用,但在客户端尝试连接时,它在服务器上抛出了更多错误。如果有帮助的话,我可以改正那些错误。

请参阅错误。

这个错误是怎么说的?

服务器和客户端之间的不匹配是什么?

如何解决此问题并使其发挥作用?

我已经设法获得了一个GDB服务器和GDB客户端,它们适用于我的32位Ubuntu(客户端GDB)和ARM Cortex A8目标(GDB服务器)。我从Linaro工具链二进制链接中获得了预构建的二进制文件。

这些效果很好!

我还尝试了4.9工具链的更新版本,它也很有效。

最新更新