Ubuntu下VS Code调试无法查看std::set/std::map等STL容器内容
Ubuntu下VS Code调试无法查看std::set/std::map内容的问题
在Ubuntu系统的VS Code中使用调试器时,遇到以下问题:
- 无法查看
std::set和std::map的内容,仅能看到对应截图中的信息 - 自定义类的
std::vector内容可正常查看
已尝试的解决操作:
- 修改
launch.json配置后仅解决了std::vector的查看问题,std::set和std::map仍无法正常查看 - 已安装最新版
libstdc++6,版本信息:libstdc++6 is already the newest version (12.1.0-2ubuntu1~22.04) - 确认路径
/usr/share/gcc/python/libstdcxx存在,包含文件:__init__.py、__pycache__、v6
当前launch.json配置如下:
{ "version": "0.2.0", "configurations": [ { "name": "(gdb) Launch", "type": "cppdbg", "request": "launch", "preLaunchTask": "Build", "program": "pathToExecutable", "args": [], "stopAtEntry": false, "cwd": "/PathToProject/", "environment": [], "externalConsole": false, "MIMode": "gdb", "setupCommands": [ { "description": "Test", "text": "python import sys;sys.path.insert(0, '/usr/share/gcc/python');from libstdcxx.v6.printers import register_libstdcxx_printers;register_libstdcxx_printers(None)", "ignoreFailures": false }, { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ] }
内容的提问来源于stack exchange,提问作者MA19
相关产品推荐
相关产品推荐

