是否可以使用vscode附加到远程gdb目标? [英] Is it possible to attach to a remote gdb target with vscode?
问题描述
我正在尝试配置配置以附加到运行带有Visual Studio代码的gdbserver的远程C/C ++ gdb目标.目前支持吗?如果是这样,我该如何解决这些限制:
I'm trying to setup the configuration to attach to a remote C/C++ gdb target running gdbserver with visual studio code. Is this currently supported? If so, how do I get around these limitations:
-
地址和端口选项表明C/C ++不支持它们.
The address and port options indicate that they aren't supported for C/C++.
我可以强制代码使用特殊的远程启用的gdb版本,但是它会尝试在本地运行目标应用程序而不连接到目标gdbserver平台.
I can force code to use the special remote enabled version of gdb, but its trying to run the target application locally and not connecting to the target gdbserver platform.
假设我可以解决#1和#2,是否将支持PowerPC远程目标?
Will PowerPC remote targets be supported assuming I can solve #1 and #2?
推荐答案
这有点晚了,但是我现在才进行设置. 我正在调试在远程ARM设备上运行的linux应用程序
This is a bit late, but I just set this up right now. I'm debugging an linux application running on a remote ARM device
我为VS Code安装了本地调试扩展.
I installed the Native Debug extension for VS Code.
这是我的launch.json配置
Here is my launch.json configuration
"configurations": [
{
"type": "gdb",
"request": "attach",
"name": "Attach to gdbserver",
"executable": "<path to exe relative to workspace root>",
"target": "X.X.X.X:9999",
"remote": true,
"cwd": "${workspaceRoot}",
"gdbpath": "D:/gcc-ma/bin/arm-linux-gnueabihf-gdb.exe"
}]
因此在运行Linux的我的手臂设备上:
So on my arm device running linux:
gdbserver localhost:9999 ./<application>
然后在Windows上,我连接到该服务器.
Then on windows, I attach to that server.
我设置了gdbpath,因为我需要使用可以理解arm的gdb版本.我从此处
I have gdbpath set up because i need to use a version of gdb that understands arm. I got the correct windows binaries from here
一路上我有很多帮助
- http://austinhanson.com/vscode-gdb-and-debugging- an-os
- https://github.com/WebFreak001/code-debug
- https://github.com/Microsoft/vscode-cpptools/issues/78
- http://austinhanson.com/vscode-gdb-and-debugging-an-os
- https://github.com/WebFreak001/code-debug
- https://github.com/Microsoft/vscode-cpptools/issues/78
这篇关于是否可以使用vscode附加到远程gdb目标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!