VS Code:局部变量未正确显示

Rob*_*t75 6 c++ mingw-w64 visual-studio-code

抱歉,如果之前有人问过这个问题,但我没有得到之前给出的答案。我是 VS Code 新手,了解一些 C++ 编码。我尝试了 windows/mingw 的教程:\n https://code.visualstudio.com/docs/cpp/config-mingw#_step-through-the-code \n 并完成了到目前为止的所有操作。示例代码已构建,我现在想进行调试,但在调试时单步执行应用程序时,我的变量视图显示了不同的内容。(见附图)\n在此输入图像描述\n该单词应包含任何字符串,并且 msg 应显示不同的内容。不过,我的自制手表显示正确。这是怎么回事?我按照教程中的方式做了所有事情。

\n

另外:终端选项卡不会从 cout 输出消息,但我在调试控制台中看到它。(参见“设置手表”章节上方教程中的图片)

\n

launch.json 是:

\n
{\n    // Use IntelliSense to learn about possible attributes.\n    // Hover to view descriptions of existing attributes.\n    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n    "version": "0.2.0",\n    "configurations": [\n        \n\n        {\n            "name": "g++.exe - Aktive Datei erstellen und debuggen",\n            "type": "cppdbg",\n            "request": "launch",\n            "program": "${fileDirname}\\\\${fileBasenameNoExtension}.exe",\n            "args": [],\n            "stopAtEntry": true,\n            "cwd": "${workspaceFolder}",\n            "environment": [],\n            "externalConsole": false,\n            "MIMode": "gdb",\n            "miDebuggerPath": "C:\\\\MinGW\\\\bin\\\\gdb.exe",\n            "setupCommands": [\n                {\n                    "description": "Automatische Strukturierung und Einr\xc3\xbcckung f\xc3\xbcr \\"gdb\\" aktivieren",\n                    "text": "-enable-pretty-printing",\n                    "ignoreFailures": true\n                }\n            ],\n            "preLaunchTask": "C/C++: g++.exe build active file"\n        }\n    ]\n}\n
Run Code Online (Sandbox Code Playgroud)\n

抱歉,我是 VS Code 新手:-/

\n

Rob*_*t75 3

我使用 sourceforge 中的 64 位版本的 MinGW 重新安装,因为我通过 mingw-get 运行了旧的 32 位版本。