vscode远程调试C++需要做的配置工作
在.vscode中新增两个配置文件
launch.json
{
// 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": "SMA",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/SMA/client/storesma",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++ sma"
}
]
}
tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "g++ sma",
"command": "g++",
"args": [
"-g",
"-I",
"/home/rtt/testSma/SMA/SMA/include",
"-std=c++0x",
"${workspaceFolder}/client/storeDataToRedis/storeDataToRedis.cpp",
"-L",
"../lib_x64",
"-l",
"crypto",
"-l",
"curl",
"-l",
"zmq",
"-l",
"log4cplus",
"-l",
"boost_filesystem",
"-l",
"boost_system",
"-l",
"boost_thread",
"-l",
"cpprest",
"-l",
"cpp_redis",
"-l",
"tacopie",
"-l",
"pthread",
"-o",
"${workspaceFolder}/SMA/client/storesma"
],
"options": {
"cwd": "${workspaceFolder}"
}
}
]
}