gpt4 book ai didi

visual-studio-code - "Run Without Debugging"确实在 VS Code 的断点处停止。错误还是设计?

转载 作者:行者123 更新时间:2023-12-05 04:55:04 25 4
gpt4 key购买 nike

我正在运行一个简单的 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开发组的答复。它既不是设计也不是错误,但尚未实现。^^

Their response here

供您引用:

#5680 的副本

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

参见:#5680(评论)

关于visual-studio-code - "Run Without Debugging"确实在 VS Code 的断点处停止。错误还是设计?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65593283/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com