Bug 108718 - LLDB: add synthetic provider for WTF::HashTable
Summary: LLDB: add synthetic provider for WTF::HashTable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-01 15:49 PST by Jer Noble
Modified: 2013-02-01 16:53 PST (History)
3 users (show)

See Also:


Attachments
Patch (4.91 KB, patch)
2013-02-01 15:55 PST, Jer Noble
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2013-02-01 15:49:50 PST
LLDB: add synthetic provider for WTF::HashTable
Comment 1 Jer Noble 2013-02-01 15:55:31 PST
Created attachment 186176 [details]
Patch
Comment 2 Darin Adler 2013-02-01 15:59:21 PST
Comment on attachment 186176 [details]
Patch

Wow, neat. Tell us how to use this!
Comment 3 Jer Noble 2013-02-01 16:05:05 PST
Thanks!

There are some short instructions at the top of the lldb_webkit.py file:

    LLDB Support for WebKit Types

    Add the following to your ~/.lldbinit file to add WebKit Type summaries in LLDB and Xcode:

    command script import {Path to WebKit Root}/Tools/lldb/lldb_webkit.py

(You can also paste that command into into a running LLDB session.)

You'll need to restart Xcode after updating this file, but once you do, the Xcode variables view will allow you to inspect the contents of a HashTable, i.e. it will act as if the HashTable variable was an array of length var.m_tableSize.

Example from command-line lldb:

(lldb) p foo.m_impl
(WTF::HashSet<const char *, WTF::PtrHash<const char *>, WTF::HashTraits<const char> >::HashTableType) $0 = { tableSize = 64, keyCount = 3 } {
  (const char *) [0] = 0x0000000000000000
  (const char *) [1] = 0x0000000000000000
  (const char *) [2] = 0x0000000000000000
  (const char *) [3] = 0x0000000000000000
  (const char *) [4] = 0x0000000000000000
Comment 4 Jer Noble 2013-02-01 16:53:20 PST
Committed r141666: <http://trac.webkit.org/changeset/141666>