Skip to content

Linaro GDB remote debugging #2432

@mal10c

Description

@mal10c

I'm trying to configure Visual Studio Code to remotely debug GDB. GDB server is running on Linux on a Raspberry Pi and Visual Studio Code is running on Windows.

I should note that I'm running Linaro GDB as a cross-compiler (but I don't think that matters in this case).

From Linux I can start GDB server with:

gdbserver --attach 10.0.0.1:9999 15717

Where 15717 is the PID of my running process I want to debug.

From Windows I can use GDB via Command Line with this:

arm-linux-gnueabihf-gdb TheProgram -ex "target extended 10.0.0.2:9999"

And that all works.

When I move over from the Command Prompt to Visual Studio Code, I get some problems (and I think it has to do with absolute paths). I set up my launch.json file with this:

{
   "version": "0.2.0",
   "configurations": [
      {
         "type": "gdb",
         "request": "attach",
         "name": "Attach to gdbserver",
         "executable": "./TheProgram",
         "printCalls": true,
         "target": "10.0.0.2:9999",
         "remote": true,
         "cwd": "${workspaceRoot}/build/RaspberryPi"
      }
   ]
}

And make sure the GDB server is running. Then I start debugging and in the Debug Console I see this:

7-break-insert -f "H:\projects\TheProgram.cpp:93"
No source file named H:\projects\TheProgram.cpp.

I think the issue is Visual Studio Code is inserting the absolute path when issuing the break-insert command. Is there a way to change that so it's using a relative path?

I think it would work if I could find a way to see this instead:

7-break-insert -f "TheProgram.cpp:93"

I should also note that in Visual Studio Code, I opened the H:\projects folder and that's what I'm working from.

I'm submitting this as an issue because I think it might be a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions