gpt4 book ai didi

c++ - 我的VSCode调试器未显示任何变量值(附加图像)(C++)

转载 作者:行者123 更新时间:2023-12-02 10:14:08 27 4
gpt4 key购买 nike

我最近开始使用VSCode,似乎无法弄清楚如何使用调试器。C++调试器没有显示任何可读的值。
附:我已经从微软安装了C++ intellisense扩展。
编辑:screenshot after stepping over
Variable not showing their values during debugging
我的launch.json:

{
"version": "0.2.0",
"configurations": [

{
"name": "g++.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++.exe build active file"
}
]
}
我的task.json:
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "g++.exe build active file",
"command": "C:\\MinGW\\bin\\g++.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "C:\\MinGW\\bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "shell",
"label": "C/C++: g++.exe build active file",
"command": "C:\\MinGW\\bin\\g++.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

最佳答案

按照@StupidMan的指示卸载MinGW-w32并安装MinGW-W64

关于c++ - 我的VSCode调试器未显示任何变量值(附加图像)(C++),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62530528/

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