Bug 1460674 - part 4 - update gdb pretty-printing to grok the new layout; r=tromey
authorNathan Froyd <froydnj@mozilla.com>
Mon, 26 Nov 2018 16:24:49 -0500
changeset 504500 79b6eb03c0c9999c3bed469344aa9cdbaa122374
parent 504499 d94b469a0faa1b82ce5ca2a60b1d3825fed44d06
child 504501 bfdd8cc5f88a25e42e95a908611550d9a5a09a5e
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstromey
bugs1460674
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1460674 - part 4 - update gdb pretty-printing to grok the new layout; r=tromey
third_party/python/gdbpp/gdbpp/thashtable.py
--- a/third_party/python/gdbpp/gdbpp/thashtable.py
+++ b/third_party/python/gdbpp/gdbpp/thashtable.py
@@ -111,25 +111,30 @@ class thashtable_printer(object):
         capacity = 1 << (hashBits - table['mHashShift'])
 
         # Pierce generation-tracking EntryStore class to get at buffer.  The
         # class instance always exists, but this char* may be null.
         store = table['mEntryStore']['mEntryStore']
 
         key_field_name = self.key_field_name
 
+        # The entry store is laid out with hashes for all possible entries
+        # first, followed by all the entries.
+        pHashes = store.cast(hashType.pointer())
+        pEntries = pHashes + capacity
+        pEntries = pEntries.cast(self.entry_type.pointer())
         seenCount = 0
-        pEntry = store.cast(self.entry_type.pointer())
         for i in range(0, int(capacity)):
-            entry = (pEntry + i).dereference()
-            # An mKeyHash of 0 means empty, 1 means deleted sentinel, so skip
+            entryHash = (pHashes + i).dereference()
+            # An entry hash of 0 means empty, 1 means deleted sentinel, so skip
             # if that's the case.
-            if entry['mKeyHash'] <= 1:
+            if entryHash <= 1:
                 continue
 
+            entry = (pEntries + i).dereference()
             yield ('%d' % i, entry[key_field_name])
             if self.is_table:
                 yield ('%d' % i, entry['mData'])
 
             # Stop iterating if we know there are no more occupied slots.
             seenCount += 1
             if seenCount >= entryCount:
                 break