微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

“不调试运行”会在 VS Code 的断点处停止错误还是设计?

如何解决“不调试运行”会在 VS Code 的断点处停止错误还是设计?

我正在运行一个简单的 C++ 程序并在 VS Code 中设置了一个断点。当我选择“Run without Debugging”时,会在断点处停止。这是设计还是错误?至少,它的行为与 good & ole Visual Studio 不同。 提前致谢。

供您参考,我的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"
        },

launch.json 如下图:

    "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 Code-cpptools 开发团队那里得到了答案。它既不是设计也不是错误,但尚未实现。^^

autoscaling group

供您参考:

#5680 的重复

cpptools 调试器(cppvsdbg 和 cppdbg)不支持不调试就运行。 我们忽略 LaunchRequestArguments 中的 noDebug 布尔值。我们将开始一个调试会话。 这将需要实施。

见:#5680(评论)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。