MIEngine: Entire struct not displayed in debugger
Working with the glm library, struct contents are being partially displayed by gdb. This is a gist of what glm::tvec2 looks like…
template<typename T>
struct tvec2
{
union {T x, r, s;};
union {T y, g, t;};
}
This is what is shown in the debugger…

My launch.json file is
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) App",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/build/<app_name>",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"linux": {
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
}
]
Here are my system details:
Ubuntu 18.04
gcc v7.3.0
gdb v8.1.0
VSCode 1.30.2
ms-vscode.cpptools v0.20.1
How do I get the debugger to display the entire contents of the struct? In the image shown, minEdgePoint and maxEdgePoint do not display the union with y,g,t values.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (1 by maintainers)
Commits related to this issue
- Fix for microsoft/MIEngine#820 Add a counter to the end of the variable name starting at 2 when there are duplicates — committed to microsoft/MIEngine by pieandcakes 7 years ago
- Fix for microsoft/MIEngine#820 Add a counter to the end of the variable name starting at 2 when there are duplicates — committed to microsoft/MIEngine by pieandcakes 7 years ago
- Fix for microsoft/MIEngine#820 Add a counter to the end of the variable name starting at 2 when there are duplicates — committed to microsoft/MIEngine by pieandcakes 7 years ago
- Fix for microsoft/MIEngine#820 (#873) Add a counter to the end of the variable name starting at 2 when there are duplicates — committed to microsoft/MIEngine by pieandcakes 7 years ago
@pieandcakes I am getting this error using the GLM natvis file provided inside the glm repo. I appreciate this is closed and from 2019 but its the most relevant and only exact result online for this issue. I am using the exact same natvis file for my msvc debugger launch and it works flawlessly.
I am launching via the below launch.json using the GDB debugger and the Cmake extension.
Version/Extension:
launch.json:
I can provide the GLM natvis but its as-provided in the repo here
Debug console in VS prints below when I expand a vec3: