Closed Bug 1481577 Opened 2 years ago Closed 2 years ago

GDB printing for hash tables is broken

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: jld, Assigned: froydnj)

References

Details

Attachments

(1 file)

I tried to print a value that contains an XPCOM hash table, and:

  mBlockers = nsTHashtable<nsUint64HashKey>Traceback (most recent call last):
  File "third_party/python/gdbpp/gdbpp/thashtable.py", line 109, in children
    capacity = 1 << (table['kHashBits'] - table['mHashShift'])
gdb.error: There is no member or method named kHashBits.

It looks like kHashBits was renamed in bug 1477626 (in the “introduce mozilla::HashNumber” patch).
kHashBits was renamed to mozilla::kHashNumberBits, which seems awkward
to access from the pretty-printer.  So we compute its value from the
HashNumber type instead.
Attachment #9027539 - Flags: review?(ttromey)
Assignee: nobody → nfroyd
Blocks: 1460674
Comment on attachment 9027539 [details] [diff] [review]
make nsTHashtable pretty-printer aware of naming changes

Review of attachment 9027539 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for doing this.  This looks good to me.
Attachment #9027539 - Flags: review?(ttromey) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/73de720af49d
make nsTHashtable pretty-printer aware of naming changes; r=tromey
https://hg.mozilla.org/mozilla-central/rev/73de720af49d
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Would it be possible to write a test that would catch this kind of breakage?
You need to log in before you can comment on or make changes to this bug.