GDB 远程调试
可以 vscode 不需要安装其他插件,直接通过本地 ssh 开启 gdb attach 远程调试。
其中依赖的 plink.exe 可自行下载,唯一的缺(省)点(事)就是密码是明文的,也可以使用 ssh 证书登录。
配置在最后,注意替换<>的部分。
配置
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "game",
"type": "cppdbg",
"request": "attach",
"program": "<program_path>",
"MIMode": "gdb",
"processId":"${command:pickRemoteProcess}",
"pipeTransport": {
"pipeProgram": "D:\\tools\\plink.exe",
"pipeArgs": ["-l", "<username>", "-pw", "<password>", "<remote_host>", "-batch"],
"debuggerPath": "/usr/bin/gdb",
},
"sourceFileMap":{
"<remote_source_path>": "<local_source_path>"
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}