远程GDB会话“命令已中止”

问题描述 投票:2回答:1

我正在使用VSCode,为RPi编写代码。我几乎已经将它设置为使用集成调试器,但是,我遇到了GDB说Command Aborted的问题

这是VSCode中调试窗口的输出

<License and whatnot from GDB>
=cmd-param-changed,param="pagination",value="off"
Reading /lib/ld-linux.so.3 from remote target...
Reading /lib/ld-linux.so.3 from remote target...
Reading /lib/f72fb00897d4f06093d6f0451c9ca7d1f6e14c.debug from remote target...
Reading /lib/.debug/f72fb00897d4f06093d6f0451c9ca7d1f6e14c.debug from remote target...
0x76fce9e0 in ?? () from target:/lib/ld-linux.so.3
Loaded 'target:/lib/ld-linux.so.3'. Symbols loaded.
ERROR: Command aborted.

这是我用来在RPi上设置gdbserver的脚本(为了保护我的隐私而排除了变量名称)。

ssh \
  -L$port:localhost:$port $user@$remote \
  "zsh -l -c './kill-gdbserver.sh && cd msat-pi* && ./waf && gdbserver :$port ./build/examples/onewire/onewire'"

以及我launch.json的相关配置

{
    "name": "1w-Remote",
    "type": "cppdbg",
    "request": "launch",
    "program": "${workspaceRoot}/build/examples/onewire/onewire",
    "miDebuggerServerAddress": "localhost:8081",
    "targetArchitecture": "arm",
    "args": [],
    "miDebuggerPath": "/usr/bin/gdb-arm",
    "preLaunchTask": "waf-build",
    "stopAtEntry": false,
    "cwd": "${workspaceRoot}",
    "environment": [],
    "externalConsole": true,
    "linux": {
      "MIMode": "gdb"
    },
    "osx": {
      "MIMode": "gdb"
    },
    "windows": {
      "MIMode": "gdb"
    }
  }

如果我在本地手动设置GDB,我得到相同的输出,除了没有Command Aborted消息。我可以然后continue,它按照我的预期行事(我的程序在未处理的异常中崩溃)。

有什么方法可以避免这个Command Aborted问题,或者我应该在VSCode git上打开一个问题?

谢谢

c++11 gdb visual-studio-code raspberry-pi3 gdbserver
1个回答
2
投票

您编译了程序而没有调试信息。使用-g编译器和链接器选项编译它。

© www.soinside.com 2019 - 2024. All rights reserved.