Visual studio code &引用;“不调试运行”;在VS代码中的断点处停止。一个bug还是一个设计? 我正在运行一个简单的C++程序,并在VS代码中设置断点。当我选择“不调试运行”时,会在断点处停止。这是设计还是错误?至少,它的行为与good&olevisualstudio不同。 提前谢谢

Visual studio code &引用;“不调试运行”;在VS代码中的断点处停止。一个bug还是一个设计? 我正在运行一个简单的C++程序,并在VS代码中设置断点。当我选择“不调试运行”时,会在断点处停止。这是设计还是错误?至少,它的行为与good&olevisualstudio不同。 提前谢谢,visual-studio-code,gdb,vscode-settings,vscode-debugger,Visual Studio Code,Gdb,Vscode Settings,Vscode Debugger,我的tasks.json如下所示,供您参考: { // build hellowhox "type": "cppbuild", "label": "build hellowhox", "command": "C:/msys64/mingw64/bin/g++.exe",

我的
tasks.json
如下所示,供您参考:

        {   // build hellowhox
            "type": "cppbuild",
            "label": "build hellowhox",
            "command": "C:/msys64/mingw64/bin/g++.exe",
            "args": [
                "-g", "-DDEBUG", 
                "-o", "${cwd}/hellowhox", "${cwd}/hellowhox.cpp", 
            ],
            "options": {
                "cwd": "C:/msys64/mingw64/bin"
            },
            "problemMatcher": [ "$gcc" ],
            "group": "build",
            "detail": "compiler: C:/msys64/mingw64/bin/g++.exe"
        },
    "configurations": [
        {
            "name": "g++.exe",
            "type": "cppdbg",
            "request": "launch",
            "program": "${cwd}/hellowhox.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "C:\\msys64\\mingw64\\bin",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "build hellowhox"
        }
launch.json
如下所示:

        {   // build hellowhox
            "type": "cppbuild",
            "label": "build hellowhox",
            "command": "C:/msys64/mingw64/bin/g++.exe",
            "args": [
                "-g", "-DDEBUG", 
                "-o", "${cwd}/hellowhox", "${cwd}/hellowhox.cpp", 
            ],
            "options": {
                "cwd": "C:/msys64/mingw64/bin"
            },
            "problemMatcher": [ "$gcc" ],
            "group": "build",
            "detail": "compiler: C:/msys64/mingw64/bin/g++.exe"
        },
    "configurations": [
        {
            "name": "g++.exe",
            "type": "cppdbg",
            "request": "launch",
            "program": "${cwd}/hellowhox.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "C:\\msys64\\mingw64\\bin",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "build hellowhox"
        }

最后,我从VS代码cpptools开发团队得到了一个答案。它既不是设计,也不是bug,但尚未实现^^

供您参考:

#5680的副本

cpptools调试器(cppvsdbg和cppdbg)不支持在不进行调试的情况下运行。 我们忽略LaunchRequestArguments中的noDebug布尔值。我们将启动一个调试会话。 这将需要实施


请参阅:#5680(评论)

最后,我从VS代码cpptools开发团队得到了一个答案。它既不是设计,也不是bug,但尚未实现^^

供您参考:

#5680的副本

cpptools调试器(cppvsdbg和cppdbg)不支持在不进行调试的情况下运行。 我们忽略LaunchRequestArguments中的noDebug布尔值。我们将启动一个调试会话。 这将需要实施

见:#5680(评论)