README 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. # This package includes a gcc plugin, which can be loaded when debugging gcc,
  2. # to show internal structures graphically.
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 2 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. ###########
  17. # Install #
  18. ###########
  19. The plugin requires gcc-8 version or later, which supports the plugin features. To install it, run the following commands,
  20. ./autogen.sh
  21. ./gcc8.sh
  22. make
  23. make install
  24. make distclean
  25. #########
  26. # Usage #
  27. #########
  28. 1. Use plugin in gdb.
  29. 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".
  30. You can use -fplugin-arg-gml4gtk-viewer=gml4gtk to select dot viewer
  31. 2. Use plugin without gdb.
  32. The plugin also can work without gdb, using -fplugin-arg-gml4gtk_plugin-option. Options are,
  33. * cgraph ---- dump the call graph before IPA passes.
  34. * cgraph-callee ---- dump the callee graph for each function.
  35. * cgraph-caller ---- dump the caller graph for each function.
  36. * gimple-hierarchy ---- dump the gimple hierarchy graph.
  37. * help ---- show this help.
  38. * passes ---- dump the passes graph.
  39. * pass-lists ---- dump the pass lists graph.
  40. * tree-hierarchy ---- dump the tree hierarchy graph.
  41. * viewer=name ---- set the dot viewer
  42. Here's an example about how to use dot plugin without gdb:
  43. gcc -fplugin=/path/to/gml4gtk_plugin.so -fplugin-arg-gml4gtk_plugin-cgraph foo.c
  44. There are examples in "example" directory.
  45. ##############
  46. # Bug report #
  47. ##############
  48. Any suggestion or bug report are welcome.