From 7a7cd9de6cc973b41de9b8d770186d59db87647d Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 12 May 2020 16:42:42 -0400 Subject: [PATCH] gdb: Fix iterating GstStructure fields This broke with 1b568fa01fa16885c3a7368551034c206493a41a where we inlined the array Part-of: --- libs/gst/helpers/gst_gdb.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/gst/helpers/gst_gdb.py b/libs/gst/helpers/gst_gdb.py index 88b0ab8f5e..7deb826fd4 100644 --- a/libs/gst/helpers/gst_gdb.py +++ b/libs/gst/helpers/gst_gdb.py @@ -478,11 +478,12 @@ class GdbGstStructure: @save_memory_access(0) def size(self): - return int(self.val["fields"]["len"]) + return int(self.val["fields_len"]) def values(self): - for f in _g_array_iter(self.val["fields"], - gdb.lookup_type("GstStructureField")): + item = self.val["fields"].cast(gdb.lookup_type("GstStructureField").pointer()) + for i in range(self.size()): + f = item[i] key = g_quark_to_string(f["name"]) value = GdbGValue(f["value"]) yield(key, value)