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

标签 c++ debugging visual-studio-code

我最近开始使用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/

相关文章:

python - 来自 Python 的 Perl 脚本调用错误

ios - 为什么我的 Xcode 6 会崩溃?

visual-studio-code - 是否可以使用 Visual Studio Code Markdown 创建和预览表格?

java - VS2015 - 在 Android 项目中引用 .so 文件

c++ - 类对数据结构的重要性

c++ - 如何使用threadfence/CUDA5.5

python - 如何调试python中的缩进错误

linux - VS Code SSH 远程连接问题

c++ - VSCode错误: "incorrect use of va_start"

c++ - 为什么我的对象在 list::push_back() 之后会发生变化