you should be using MinGW, the update of MinGW is slow, and the support for container Vector,Map in STL is not good enough. You can use TDM-GCC, a compiled body debugging tool, which supports better.
< H2 > Windows when VS code debug cannot view the contents of the CPP STL container < / H2 >
first of all, you are likely to use the x64 version of Windows.
I found an effective solution, but when installing MinGW on x64 version of Windows, although the official recommended version of MinGW is x86q64, after practice, it is found that if you choose to install x86x64, it is very likely that you will not be able to see the specific information of STL containers (vecotr, map, etc.) when Debug, and you will see the corresponding memory address ~
. Therefore, it is recommended to choose i686 (win32)
. Then the next step of the installation step and the rest of the operation will follow the default.
win32 MinGW:
i686-posix-dwarf
MinGW D:\MinGW
MinGWbin D:\MinGW\i686-8.1.0-release-posix-dwarf-rt_v6-rev0\mingw32\bin
PATH
and my corresponding configuration files are as follows:
, .vscode\ tasks.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.19041.0",
"compilerPath": "gPP", // Or complete absolute path "D:/MinGW/i686-8.1.0-release-posix-dwarf-rt_v6-rev0/mingw32/bin/gPP.exe"
"cStandard": "c11",
"cppStandard": "cPP17",
"intelliSenseMode": "clang-x86"
}
],
"version": 4
}
< H2 > attach the environment configuration of my computer < / H2 >
VSCode Version: 1.53.2 (system setup)
OS Version: Windows 10 x64 (Windows_NT x64 10.0.19041)
MinGW version: i686-8.1.0-release-posix-dwarf-rt_v6-rev0
GDB version: 8.1.0 (Target: i686-w64-mingw32)
I hope it will be useful to you. If you have any questions, please leave a message.