MinGW C++和vscode漂亮的打印调试不起作用



我正试图弄清楚为什么漂亮的打印无法正常工作。我找了很多地方,试图找出为什么它不起作用,但我还没有找到解决方案。

问题是:

vscode屏幕截图

正如您所看到的,向量state没有显示其元素。这是我的启动json:

{
"version": "0.2.0",
"configurations": [
{
"name": "gdb",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"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": "build"
}
]
}

这是我的任务.json:

{
"tasks": [
{
"type": "shell",
"label": "build",
"command": "C:\MinGW\bin\g++.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "C:\MinGW\bin"
}
}
],
"version": "2.0.0"
}

我开始工作了。这是拯救我的帖子:

如何在Eclipse CDT中为C++STL对象启用gdb漂亮打印?

我遵循了标签上的说明:

这适用于使用Eclipse CDT的MinGW用户

我将.gdbinit放在我的cpp项目文件夹根目录中以供参考。

最新更新