I am trying to write a launch configuration for VS Code that can start gdbserver
as a preLaunchTask.
When I start debugging, everything just stalls when gdbserver says "Listening on port XXXX"
I found many examples online of methods for other debuggers, but nothing specific for gdbserver.
I have tried setting isBackground
to true
to no avail, along with trying to set up a problemMatcher
I couldn't find any documentation that seemed to explain how to write your own problemMatcher
either.
So, how do I write a task that can start gdbserver as part of a preLaunchTask for my debugger?
Here is my task to start gdbserver
{
"label": "run",
"type": "shell",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "dedicated"
},
"options": {
"cwd": "${workspaceRoot}/build"
},
"command": "ssh",
"args": [
"root@remote",
"'gdbserver localhost:9091 program'"
]
}
Here is my launch configuration
{
"name": "Remote Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/program",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "run",
"miDebuggerServerAddress": "remote:9091",
"miDebuggerPath": "aarch64-sbs-linux-gdb"
}
]