报错:
Unable to determine path to debugger. Please specify the "MIDebuggerPath" option.
解决方法: 没有安装gdb, CentOS 安装gdb: yum -y install gdb
1、创建 tasks.json
在vscode的主菜单栏单击 Terminal --> Configure Tasks --> Create tasks.json file from template --> Others ,生成的tasks.json 如下所示:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "echo Hello"
}
]
}
将其修改成如下:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build-debug",
"command": "make",
"args"

本文详细介绍了在VSCode中配置C++调试环境的步骤,包括安装gdb,创建并修改tasks.json和launch.json文件,以及如何设置断点进行调试。

2757

被折叠的 条评论
为什么被折叠?



