首页 > 解决方案 > 在 Visual Studio 代码中调试 C++ 时,我的代码不会在断点处停止

问题描述

我的 IDE 没有在断点处停止。我无法浏览代码。我不知道如何进行。

我是工科学生。

这是launch.json

{
"version": "0.2.0",
"configurations": [
    {
        "name": "g++.exe - Build and debug active file",
        "type": "cppdbg",
        "request": "launch",
        "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
        "args": [
            "run",
            "debug",
        ],
        "stopAtEntry": false,
        "cwd": "${workspaceFolder}",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "miDebuggerPath": "C:\\Program Files (x86)\\Falcon\\MinGW\\bin\\gdb.exe",
        "setupCommands": [
            {
                "description": "Enable pretty-printing for gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            }
        ],
        "preLaunchTask": "C/C++: g++.exe build active file"
    }
]

这是tasks.json

     {
"tasks": [
    {
        "type": "shell",
        "label": "C/C++: g++.exe build active file",
        "command": "C:\\Program Files (x86)\\Falcon\\MinGW\\bin\\g++.exe",
        "args": [
            "-Wall",
            "-Wextra",
            "-g",
            "*.cpp",
            "-o",
            "${fileDirname}\\${fileBasenameNoExtension}.exe"
        ],
        "options": {
            "cwd": "${workspaceFolder}"
        },
        "problemMatcher": [
            "$gcc"
        ],
        "group": {
            "kind": "build",
            "isDefault": true
        }
    }
],
"version": "2.0.0"
}

我会感谢你们可以提供的任何帮助。

标签: visual-studio-codebreakpoints

解决方案


推荐阅读