Leonard Grey | 99ade23 | 2018-07-31 14:58:25 | [diff] [blame] | 1 | # Copyright 2018 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | # Creates a SVG graph of the view hierarchy, when stopped in a |
| 6 | # method of an object that inherits from views::View. Requires |
| 7 | # graphviz. |
| 8 | # |
| 9 | # For more info see |
| 10 | # chromium/src/+/HEAD/docs/graphical_debugging_aid_chromium_views.md |
| 11 | # |
| 12 | # To make this command available, add the following to your ~/.lldbinit: |
| 13 | # source {Path to SRC Root}/tools/gdbviewg.gdb |
| 14 | # |
| 15 | # Usage: type `viewg` at the GDB prompt, given the conditions above. |
| 16 | |
| 17 | |
| 18 | define viewg |
| 19 | if $argc != 0 |
| 20 | echo Usage: viewg |
| 21 | else |
| 22 | set pagination off |
| 23 | set print elements 0 |
| 24 | set logging off |
| 25 | set logging file ~/state.dot |
| 26 | set logging overwrite on |
| 27 | set logging redirect on |
| 28 | set logging on |
| 29 | printf "%s\n", view::PrintViewGraph(this).c_str() |
| 30 | set logging off |
| 31 | shell dot -Tsvg -o ~/state.svg ~/state.dot |
| 32 | set pagination on |
| 33 | end |
| 34 | end |