【问题标题】:Error connecting to remote gdbserver through gdb通过 gdb 连接到远程 gdbserver 时出错
【发布时间】:2019-04-16 17:08:35
【问题描述】:

我有一个使用 -p 2000:2000 运行的 docker 容器,它在端口 2000 上运行一个 gdbserver。

当尝试通过 gdb 从我的主机连接时,我得到以下信息:

(gdb) target remote localhost:2000
Remote debugging using localhost:2000
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Remote replied unexpectedly to 'vMustReplyEmpty': timeout

在 docker 容器中运行的应用程序是用 C++ 编写的,在 fcgi (gdbserver :2000 spawn-fcgi -p 8000 -n ./myBinary) 后面

主持人

  • 操作系统:osx
  • gdb 版本:8.0.1(与 --with-all-targets 一起安装)

容器

  • 操作系统:ubuntu 14.04
  • gdb 版本:7.7.1

任何帮助将不胜感激。

【问题讨论】:

    标签: c++ docker gdb fastcgi gdbserver


    【解决方案1】:

    我遇到了同样的问题,当我运行我的 qemu 时,我想将 gdb 与 qemu 内部 gdbserver 连接起来。 我做以下工作:

    1. 在系统模式下运行 qemu。
    2. 在 qemu 中运行 gdbserver
    3. 在主机中运行 gdb 并在 gdb 中连接 gdbservr。

    软件版本如下:

    QEMU emulator version 2.12.92
    gdb 7.11.1
    GNU gdbserver (GDB) 7.8
    

    一开始我无法连接gdbserver,错误是

    (gdb) target remote 192.168.240.136:1234
    Remote debugging using 192.168.240.136:1234
    Ignoring packet error, continuing...
    warning: unrecognized item "timeout" in "qSupported" response
    Ignoring packet error, continuing...
    Remote replied unexpectedly to 'vMustReplyEmpty': timeout
    

    我通过在启动 qemu 时更改为高级内核来解决问题。从vmlinux-2.6.32-5-4kc-maltavmlinux-3.2.0-4-4kc-malta,那么start qemu的命令改为如下: p>

    sudo qemu-system-mips -M malta \
    -kernel vmlinux-3.2.0-4-4kc-malta \
    -hda debian_squeeze_mips_standard.qcow2 \
    -append "root=/dev/sda1 console=tty0" \
    -net nic,macaddr=00:16:3e:00:01:01 \
    -net tap \
    -nographic
    

    然后错误解决了,我可以将gdbserver与gdb连接起来。

    可能的解决方法还包括

    【讨论】:

      猜你喜欢
      • 2014-03-14
      • 2013-05-15
      • 2015-04-29
      • 2020-02-15
      • 2012-09-06
      • 1970-01-01
      • 1970-01-01
      • 2015-10-05
      • 1970-01-01
      相关资源
      最近更新 更多