Community
Participate
Working Groups
Suppose we wanted a better understanding of how a C/C++ program "operates". What methods are called, in what order, by which functions, etc. A visual representation of a program's call hierarchy could probably achieve this reasonably well, and it would be nice to have an Eclipse plugin that could do this. Similar to an ER model being generated given a database schema. One such way of doing this is by compiling each of the program's source files using gcc's -fdump-rtl-<pass> flag. (For more information on flags, see the gcc manual). This dumps debugging information during the specified pass of compilation. RTL (Register Transfer Language) is just a format (similar to LISP lists) that describes the various instructions performed by the CPU. As an example, we can take the source code for Systemtap, and add the following line to configure.ac : CFLAGS="-fdump-rtl-expand $CFLAGS" This will compile all C source files with the -fdump-rtl-expand flag, which dumps the debugging information after RTL generation. After compiling the project (./configure && make) we can grab all the debugging data files that have been generated and pass them to 'egypt'. Egypt (http://www.gson.org/egypt/) is a program that takes RTL data and converts it to DOT language (http://en.wikipedia.org/wiki/DOT_language). From this point we can pass the DOT language data to a graph generator provided by the Graphviz Package (http://www.graphviz.org/). cat *.expand | egypt | dot -Tjpg -o stap_egypt.jpg This would produce something as follows : http://rgrunber.fedorapeople.org/stap_egypt.jpg http://rgrunber.fedorapeople.org/stap_egypt.svg However, since our goal would be to have this be an Eclipse plugin, a graphics library such as GEF / ZEST (http://www.eclipse.org/gef/) would have to be used to achieve the rendering. Drawbacks : Large programs with many functions (nodes) can be difficult to render by egypt. Coming up with some algorithm to do this with the GEF/ZEST libraries would be challenging. As an example, the compilation of Systemtap was done only with -fdump-rtl-expand for the C source files because doing it for C++ as well produced a graph that was not possible to render in most formats and very confusing to visualize. Other possibilities for visualizing call hierarchy are discussed below : http://nion.modprobe.de/blog/archives/556-creating-dynamic-function-call-graphs.html http://www.ibm.com/developerworks/library/l-graphvis/
Roland, Zest has direct support for dot language. See http://wiki.eclipse.org/Graphviz_DOT_as_a_DSL_for_Zest for details. This should help with the last step.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Obviously nothing will happen here.