The Visual Studio MI Debug Engine ("MIEngine") provides an open-source Visual Studio Debugger extension that works with MI-enabled debuggers such as gdb and lldb.
MIT License
818
stars
218
forks
source link
TreeItems' LeftPointer and RightPointer are not evaluated #1426
Based on this issue I assume VSCode C/C++ extension uses this implementation. I tried to define a simple TreeItems. When debugging on Linux with GDB, even though natvis.xsd says so, LeftPointer and RightPointer is not evaluated. And I think the problem is the implementation of the GetTraverse function. It's also used by LinkedListItems's NextPointer, I haven't tried it but it may affect that too.
Example C++ code
template <typename T>
struct Tree {
struct Node {
Node* left = nullptr;
Node* right = nullptr;
T val;
} n1, n2, n3;
Node* head;
int size = 3;
};
int main()
{
Tree<int> tree;
tree.n1.val = 11;
tree.n2.val = 22;
tree.n3.val = 33;
tree.head = &tree.n2;
tree.n2.left = &tree.n1;
tree.n2.right = &tree.n3;
return 0;
}
Based on this issue I assume VSCode C/C++ extension uses this implementation. I tried to define a simple TreeItems. When debugging on Linux with GDB, even though natvis.xsd says so, LeftPointer and RightPointer is not evaluated. And I think the problem is the implementation of the GetTraverse function. It's also used by LinkedListItems's NextPointer, I haven't tried it but it may affect that too.
Example C++ code
.natvis definition
and related launch configuration