On Wed, Dec 12, 2012 at 1:53 PM, Richard Biener wrote:
>
> This adds the function print_graph_cfg that you can call from a
> gdb session and directly pipes a dot representation of the
> function to 'dot -Tx11'.  The only change needed to the now very
> good dumping code is splitting out the actual worker without
> the FILE handling.
>
> Probably not suitable for trunk because I use popen/pclose/fileno
> which I don't know whether they are available on all host platforms.
> So - any taker to transform this into a gdb python macro for .gdbinit
> instead?

This needs a generic solution, there are other places where calling a
dot viewer from the debugger would be helpful:

graphite-poly.c:  system ("dotty /tmp/lst.dot &");
graphite-scop-detection.c:  x = system ("dotty /tmp/allscops.dot &");
graphite-scop-detection.c:    x = system ("dotty /tmp/allscops.dot &");
tree-data-ref.c:  system ("dotty /tmp/rdg.dot &");

I'd like to add some solution for this in GCC 4.9, in part by creating
some abstraction for graph dumping and then adding a direct viewing
capability somehow (maybe even via libgraphviz).

(BTW I can recommend xdot as a "better dot -Tx11", see
http://code.google.com/p/jrfonseca/wiki/XDot. You'll want a recent
version, older copies don't render dashed edges correctly.)

Ciao!
Steven

Reply via email to