How to remotely debug C, C++ binaries installed in Linux environments in VSCode environments connected by ssh.
- Insatlling VSCode on Windows
- Installing C/C++, C/C++ Extension in VSCode
- VSCode to connect to Linux server via SSH at /home/my
- edit 'launch.json' File
{
"version": "0.2.0",
"configurations": [
{
"name": "tsblock",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/develop/bin/tsblock",
"miDebuggerServerAddress": "localhost:9999",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
]
}
]
}
How to remotely debug C, C++ binaries installed in Linux environments in VSCode environments connected by ssh.
- Insatlling VSCode on Windows
- Installing C/C++, C/C++ Extension in VSCode
- VSCode to connect to Linux server via SSH at /home/my
- edit 'launch.json' File
{
"version": "0.2.0",
"configurations": [
{
"name": "tsblock",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/develop/bin/tsblock",
"miDebuggerServerAddress": "localhost:9999",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
]
}
]
}
- gdbserver cmd execute ( binary path = /home/my/develop/bin/tsblock ) $[bash] gdbserver --attach :9999
I checked that the port is in a normal listening state.
- Push F5 at VSCode for Remote Debug
but something wrong.
The progress bar moves for a moment and then shuts down without taking any action. There is no separate exit message.
It doesn't connect either.
Is there a setting I'm missing?
I don't think there's a problem with the settings on the .vscode and .vscode-server side of Localhost. The reason is that 3 years ago, other hosts also debugged using VSCode, where the .vscode and .vscode-server directories remain the same 3 years ago. However, after reinstalling VSCode in Windows, remote debugging does not work properly even in previous host environments. (Same phenomenon)
As I reinstalled VSCode in Windows, it seems that the relevant setup file is missing.
Does anyone know about this?
Share Improve this question edited Feb 17 at 1:27 Smallrengar asked Feb 14 at 7:35 SmallrengarSmallrengar 313 bronze badges1 Answer
Reset to default 0I found the reason.
The reason is that the Version of C/C++ extension package was different.
I downgraded to v1.11.4 and ran debugging.
Finally, I can to debug successfully.
launch.json was not reason.