mooigraph 4c084cc9d0 gcc-11.1 plugin added 2 years ago
..
example 4c084cc9d0 gcc-11.1 plugin added 2 years ago
gml4gtk-plugin 4c084cc9d0 gcc-11.1 plugin added 2 years ago
AUTHORS 4c084cc9d0 gcc-11.1 plugin added 2 years ago
COPYING 4c084cc9d0 gcc-11.1 plugin added 2 years ago
ChangeLog 4c084cc9d0 gcc-11.1 plugin added 2 years ago
INSTALL 4c084cc9d0 gcc-11.1 plugin added 2 years ago
LICENSE 4c084cc9d0 gcc-11.1 plugin added 2 years ago
Makefile.am 4c084cc9d0 gcc-11.1 plugin added 2 years ago
NEWS 4c084cc9d0 gcc-11.1 plugin added 2 years ago
README 4c084cc9d0 gcc-11.1 plugin added 2 years ago
README.md 4c084cc9d0 gcc-11.1 plugin added 2 years ago
autogen.sh 4c084cc9d0 gcc-11.1 plugin added 2 years ago
configure.ac 4c084cc9d0 gcc-11.1 plugin added 2 years ago
gcc8.sh 4c084cc9d0 gcc-11.1 plugin added 2 years ago

README

# This package includes a gcc plugin, which can be loaded when debugging gcc,
# to show internal structures graphically.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .


###########
# Install #
###########

The plugin requires gcc-8 version or later, which supports the plugin features. To install it, run the following commands,

./autogen.sh
./gcc8.sh
make
make install
make distclean

#########
# Usage #
#########


1. Use plugin in gdb.

The pre-defined dot plugin commands can be used. Rename file "gml4gtk-plugin.gdbinit" to ".gdbinit" or add "source dot-plugin.gdbinit" in your original ".gdbinit".

You can use -fplugin-arg-gml4gtk-viewer=gml4gtk to select dot viewer

2. Use plugin without gdb.

The plugin also can work without gdb, using -fplugin-arg-gml4gtk_plugin-option. Options are,

* cgraph ---- dump the call graph before IPA passes.
* cgraph-callee ---- dump the callee graph for each function.
* cgraph-caller ---- dump the caller graph for each function.
* gimple-hierarchy ---- dump the gimple hierarchy graph.
* help ---- show this help.
* passes ---- dump the passes graph.
* pass-lists ---- dump the pass lists graph.
* tree-hierarchy ---- dump the tree hierarchy graph.
* viewer=name ---- set the dot viewer

Here's an example about how to use dot plugin without gdb:

gcc -fplugin=/path/to/gml4gtk_plugin.so -fplugin-arg-gml4gtk_plugin-cgraph foo.c

There are examples in "example" directory.

##############
# Bug report #
##############

Any suggestion or bug report are welcome.