blob: c664f607ae96b852ec3fdc7c166ce8305f0ddf02 [file] [log] [blame]
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Creates a SVG graph of the view hierarchy, when stopped in a
# method of an object that inherits from views::View. Requires
# graphviz.
# For more info see
# chromium/src/+/HEAD/docs/
# To make this command available, add the following to your ~/.gdbinit:
# source {Path to SRC Root}/tools/gdbviewg.gdb
# Usage: type `viewg` at the GDB prompt, given the conditions above.
define viewg
if $argc != 0
echo Usage: viewg
set pagination off
set print elements 0
set logging off
set logging file ~/
set logging overwrite on
set logging redirect on
set logging on
printf "%s\n", views::PrintViewGraph(this).c_str()
set logging off
shell dot -Tsvg -o ~/state.svg ~/
set pagination on