From 0c46b5f8e92c54786fdebfe37b038040912128da Mon Sep 17 00:00:00 2001
From: derammo <817160+derammo@users.noreply.github.com>
Date: Sun, 4 Sep 2022 12:06:26 -0400
Subject: [PATCH] added more data structures to Natvis for msdev
can now debug signal_map and connections in Objects
can now view more Variant types, such as packed arrays
---
platform/windows/godot.natvis | 84 ++++++++++++++++++++++++++++-------
1 file changed, 67 insertions(+), 17 deletions(-)
diff --git a/platform/windows/godot.natvis b/platform/windows/godot.natvis
index cdd1c149787..36b0919185b 100644
--- a/platform/windows/godot.natvis
+++ b/platform/windows/godot.natvis
@@ -32,6 +32,38 @@
+
+
+ - num_elements
+
+ num_elements
+ head_element
+ next
+ data
+
+
+
+
+
+
+ - *(reinterpret_cast<int*>(_cowdata._ptr) - 1)
+
+ *(reinterpret_cast<int*>(_cowdata._ptr) - 1)
+ reinterpret_cast<VMap<$T1,$T2>::Pair*>(_cowdata._ptr)
+
+
+
+
+
+ {dynamic_cast<CallableCustomMethodPointerBase*>(key.custom)->text}
+
+
+
+
nil
{_data._bool}
@@ -55,15 +87,17 @@
{*(Object *)_data._mem}
{*(Dictionary *)_data._mem}
{*(Array *)_data._mem}
- {*(PackedByteArray *)_data._mem}
- {*(PackedInt32Array *)_data._mem}
+ {reinterpret_cast<const Variant::PackedArrayRef<unsigned char>*>(_data.packed_array)->array}
+ {reinterpret_cast<const Variant::PackedArrayRef<int>*>(_data.packed_array)->array}
+
+ {reinterpret_cast<const Variant::PackedArrayRef<float>*>(_data.packed_array)->array}
+ {reinterpret_cast<const Variant::PackedArrayRef<double>*>(_data.packed_array)->array}
+ {reinterpret_cast<const Variant::PackedArrayRef<String>*>(_data.packed_array)->array}
+ {reinterpret_cast<const Variant::PackedArrayRef<Vector2>*>(_data.packed_array)->array}
+ {reinterpret_cast<const Variant::PackedArrayRef<Vector3>*>(_data.packed_array)->array}
+ {reinterpret_cast<const Variant::PackedArrayRef<Color>*>(_data.packed_array)->array}
((String *)(_data._mem))->_cowdata._ptr,s32
@@ -87,7 +121,7 @@
- *(Object *)_data._mem
- *(Dictionary *)_data._mem
- *(Array *)_data._mem
- - *(PackedByteArray *)_data._mem
+ - reinterpret_cast<const Variant::PackedArrayRef<unsigned char>*>(_data.packed_array)->array
- *(PackedInt32Array *)_data._mem
- *(PackedInt64Array *)_data._mem
- *(PackedFloat32Array *)_data._mem
@@ -105,6 +139,14 @@
_cowdata._ptr,s32
+
+ {*reinterpret_cast<void**>(opaque),s32}
+
+ - *reinterpret_cast<void**>(opaque)
+ - *reinterpret_cast<void**>(opaque),s32
+
+
+
{_data->cname}
{_data->name,s32}
@@ -113,6 +155,22 @@
_data->name,s32
+
+
+ {(*reinterpret_cast<const char***>(opaque))[1],s8}
+ {(*reinterpret_cast<const char***>(opaque))[2],s32}
+
+ - *reinterpret_cast<void**>(opaque)
+ - (*reinterpret_cast<const char***>(opaque))+1
+ - (*reinterpret_cast<const char***>(opaque))[1],s8
+
+
+
+
+ "{user.name}" {slot_map}
+ "{slot_map}
+
+
{{{x},{y}}}
@@ -149,12 +207,4 @@
- a
-
-
-
- - (Object*)this
- - (StringName*)(((char*)this) + sizeof(Object))
- - (Node::Data*)(((char*)this) + sizeof(Object) + sizeof(StringName))
-
-