[glib] Fix GHashTable GDB pretty printing (bug #667420)



commit 7678b10703ebe84cf869cf5929d89770f3f7f977
Author: Dan VrÃtil <dvratil redhat com>
Date:   Mon Jan 9 09:29:20 2012 +0100

    Fix GHashTable GDB pretty printing (bug #667420)

 glib/glib.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/glib/glib.py b/glib/glib.py
index 135f4bc..9a47d52 100644
--- a/glib/glib.py
+++ b/glib/glib.py
@@ -76,7 +76,9 @@ class GHashPrinter:
         def __init__(self, ht, keys_are_strings):
             self.ht = ht
             if ht != 0:
-                self.array = ht["nodes"]
+                self.keys = ht["keys"]
+                self.values = ht["values"]
+                self.hashes = ht["hashes"]
                 self.size = ht["size"]
             self.pos = 0
             self.keys_are_strings = keys_are_strings
@@ -93,11 +95,10 @@ class GHashPrinter:
                 self.value = None
                 return v
             while long(self.pos) < long(self.size):
-                node = self.array[self.pos]
                 self.pos = self.pos + 1
-                if long (node["key_hash"]) >= 2:
-                    key = node["key"]
-                    val = node["value"]
+                if long (self.hashes[self.pos]) >= 2:
+                    key = self.keys[self.pos]
+                    val = self.values[self.pos]
 
                     if self.keys_are_strings:
                         key = key.cast (gdb.lookup_type("char").pointer())



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]