GDB Python script that outputs a diagram of a subset of fields for each object, and the graph of connected objects. Generic code, can be used for other subsystems, along with one concrete gdb command "viewloadergraph" which works on xxxLoader and related.
Created attachment 102701 [details] Patch
Attachment 102701 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Tools/ChangeLog', u'Tools/gdb/webkit.py']" exit_code: 1 Tools/gdb/webkit.py:424: missing whitespace around operator [pep8/E225] [5] Tools/gdb/webkit.py:431: missing whitespace around operator [pep8/E225] [5] Tools/gdb/webkit.py:432: missing whitespace around operator [pep8/E225] [5] Tools/gdb/webkit.py:438: whitespace before '}' [pep8/E202] [5] Tools/gdb/webkit.py:452: whitespace before ']' [pep8/E202] [5] Total errors found: 5 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
CC-ed one who knows it well.
Comment on attachment 102701 [details] Patch Looks very useful command. Could you upload a sample png or a dot file? I'd like to see it. Some minor comments follows. View in context: https://bugs.webkit.org/attachment.cgi?id=102701&action=review > Tools/gdb/webkit.py:41 > +import os Please sort this lexicologically. > Tools/gdb/webkit.py:354 > + self.ptr_type = gdb.lookup_type('void').pointer() Is this member variable used? > Tools/gdb/webkit.py:357 > + return label.replace('\\', '\\\\').replace('"', '\\"') Can you use a raw string here? (r'\', r'\\' instead of '\\', '\\\\'). > Tools/gdb/webkit.py:366 > + conns = [] Could you avoid abbreviations? I think we don't have a clear style guide for gdb's Python script. But it should be better to avoid abbreviations, following other Python scripts used in WebKit. > Tools/gdb/webkit.py:369 > + if target_type in self.typemap: Could you early exit here to reduce the indent level? > Tools/gdb/webkit.py:376 > + fieldsidx = 0 Could you use fields_idx instead of fields_idx? > Tools/gdb/webkit.py:377 > + prefixchar = '.' Could you use prefix_char? >> Tools/gdb/webkit.py:424 >> + print >>f, """digraph g { > > missing whitespace around operator [pep8/E225] [5] Could you use f.write(...) instead of print statement?
Comment on attachment 102701 [details] Patch r- per unaddressed comments in comment 4.