提前安装Remote Develop插件,确保vscode可以远程到目标主机,且目标主机上也要通过vscode安装c++开发相关插件
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++ - 生成和调试活动文件",
"type": "cppdbg",
"request": "launch", //如果launch不行换成attach
"program": "${workspaceFolder}/trunk/objs/srs",
"args": ["-c" ,"${workspaceFolder}/trunk/conf/srs.conf"],
"stopAtEntry": false,
"request": "attach", //声明attach
"port": 1935, //attach 的进程启动的端口
"processId":74516, //被attach的进程ID