Is it possible to attach to a remote gdb target with vscode?

后端 未结 1 1983
时光说笑
时光说笑 2021-02-03 10:36

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 aroun

1条回答
  •  春和景丽
    2021-02-03 10:45

    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

    I installed the Native Debug extension for VS Code.

    Here is my launch.json configuration

    "configurations": [
        {
            "type": "gdb",
            "request": "attach",
            "name": "Attach to gdbserver",
            "executable": "",
            "target": "X.X.X.X:9999",
            "remote": true,
            "cwd": "${workspaceRoot}", 
            "gdbpath": "D:/gcc-ma/bin/arm-linux-gnueabihf-gdb.exe"
        }]
    

    So on my arm device running linux:

    gdbserver localhost:9999 ./
    

    Then on windows, I attach to that server.

    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

    I had lots of help along the way

    • http://austinhanson.com/vscode-gdb-and-debugging-an-os
    • https://github.com/WebFreak001/code-debug
    • https://github.com/Microsoft/vscode-cpptools/issues/78

    0 讨论(0)
提交回复
热议问题