插件C/C+++CMake+CMake Tools
只能单文件调试
主要修改配置为"program":参数 添加待调试文件生成的可执行文件路径 在dev文件夹里面,如/home/zsy/catkin_ws/devel/lib/zsy_slam/front
然后删掉最后两行。
最后josn文件类似这样
{
// 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",
"program": "/home/zsy/catkin_ws/devel/lib/zsy_slam/front",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
}
]
}