我正在使用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上打开一个问题?
谢谢
答案 0 :(得分:2)
您编译的程序没有调试信息。使用-g编译器和链接器选项编译它。