mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
Fix GHashTable GDB pretty printing (bug #667420)
This commit is contained in:
parent
82740adc61
commit
7678b10703
11
glib/glib.py
11
glib/glib.py
@ -76,7 +76,9 @@ class GHashPrinter:
|
|||||||
def __init__(self, ht, keys_are_strings):
|
def __init__(self, ht, keys_are_strings):
|
||||||
self.ht = ht
|
self.ht = ht
|
||||||
if ht != 0:
|
if ht != 0:
|
||||||
self.array = ht["nodes"]
|
self.keys = ht["keys"]
|
||||||
|
self.values = ht["values"]
|
||||||
|
self.hashes = ht["hashes"]
|
||||||
self.size = ht["size"]
|
self.size = ht["size"]
|
||||||
self.pos = 0
|
self.pos = 0
|
||||||
self.keys_are_strings = keys_are_strings
|
self.keys_are_strings = keys_are_strings
|
||||||
@ -93,11 +95,10 @@ class GHashPrinter:
|
|||||||
self.value = None
|
self.value = None
|
||||||
return v
|
return v
|
||||||
while long(self.pos) < long(self.size):
|
while long(self.pos) < long(self.size):
|
||||||
node = self.array[self.pos]
|
|
||||||
self.pos = self.pos + 1
|
self.pos = self.pos + 1
|
||||||
if long (node["key_hash"]) >= 2:
|
if long (self.hashes[self.pos]) >= 2:
|
||||||
key = node["key"]
|
key = self.keys[self.pos]
|
||||||
val = node["value"]
|
val = self.values[self.pos]
|
||||||
|
|
||||||
if self.keys_are_strings:
|
if self.keys_are_strings:
|
||||||
key = key.cast (gdb.lookup_type("char").pointer())
|
key = key.cast (gdb.lookup_type("char").pointer())
|
||||||
|
Loading…
Reference in New Issue
Block a user