gdb: Fix iterating GstStructure fields

This broke with 1b568fa01f where we inlined the array

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/479>
This commit is contained in:
Thibault Saunier 2020-05-12 16:42:42 -04:00
parent 70469b4a4c
commit 7a7cd9de6c

View file

@ -478,11 +478,12 @@ class GdbGstStructure:
@save_memory_access(0) @save_memory_access(0)
def size(self): def size(self):
return int(self.val["fields"]["len"]) return int(self.val["fields_len"])
def values(self): def values(self):
for f in _g_array_iter(self.val["fields"], item = self.val["fields"].cast(gdb.lookup_type("GstStructureField").pointer())
gdb.lookup_type("GstStructureField")): for i in range(self.size()):
f = item[i]
key = g_quark_to_string(f["name"]) key = g_quark_to_string(f["name"])
value = GdbGValue(f["value"]) value = GdbGValue(f["value"])
yield(key, value) yield(key, value)