gpt4 book ai didi

c++ - MinGW C++和vscode pretty-print 调试无法正常工作

转载 作者:行者123 更新时间:2023-12-02 10:19:30 24 4
gpt4 key购买 nike

我试图弄清楚为什么 pretty-print 无法正常工作。我在许多地方进行了尝试,以弄清楚为什么它不起作用,但是我还没有找到解决方案。

这是问题所在:

vscode screenshot

如您所见, vector state没有显示其元素。这是我的launch.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"
}
]
}

这是我的tasks.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"
}

最佳答案

我知道了。这是救了我的帖子:

How to enable gdb pretty printing for C++ STL objects in Eclipse CDT?

我遵循标有以下说明的说明:

这适用于具有Eclipse CDT的MinGW用户

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

关于c++ - MinGW C++和vscode pretty-print 调试无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60858812/

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