| Avi Drissman | dfd88085 | 2022-09-15 20:11:09 | [diff] [blame] | 1 | # Copyright 2018 The Chromium Authors |
| Leonard Grey | 99ade23 | 2018-07-31 14:58:25 | [diff] [blame] | 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 | # |
| Tom Anderson | f06ac38 | 2019-04-10 03:49:38 | [diff] [blame] | 12 | # To make this command available, add the following to your ~/.gdbinit: |
| Leonard Grey | 99ade23 | 2018-07-31 14:58:25 | [diff] [blame] | 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 |
| Aykut Bulut | f3425e61 | 2022-08-16 21:15:22 | [diff] [blame] | 24 | set logging enabled off |
| Leonard Grey | 99ade23 | 2018-07-31 14:58:25 | [diff] [blame] | 25 | set logging file ~/state.dot |
| 26 | set logging overwrite on |
| 27 | set logging redirect on |
| Aykut Bulut | f3425e61 | 2022-08-16 21:15:22 | [diff] [blame] | 28 | set logging enabled on |
| Yupei Lin | 3e4613d | 2019-03-15 02:46:22 | [diff] [blame] | 29 | printf "%s\n", views::PrintViewGraph(this).c_str() |
| Aykut Bulut | f3425e61 | 2022-08-16 21:15:22 | [diff] [blame] | 30 | set logging enabled off |
| Leonard Grey | 99ade23 | 2018-07-31 14:58:25 | [diff] [blame] | 31 | shell dot -Tsvg -o ~/state.svg ~/state.dot |
| 32 | set pagination on |
| 33 | end |
| Yupei Lin | 3e4613d | 2019-03-15 02:46:22 | [diff] [blame] | 34 | end |