On Mon, Nov 26, 2012 at 4:53 PM, Steven Bosscher <stevenb....@gmail.com> wrote: > On Mon, Nov 26, 2012 at 4:46 PM, Richard Biener wrote: >> On Fri, Nov 23, 2012 at 10:46 AM, Steven Bosscher wrote: >>> Hello, >>> >>> The graph.[ch] code to dump the CFG for viewing with VCG is quite >>> broken and hasn't been updated to follow the advances in the CFG >>> infrastructure. >>> >>> The attached patch is the first in a series of patches I have planned >>> to update the CFG-as-graph dumping code to dump GraphViz DOT input >>> instead. The attached archive is an example input/output. >>> >>> There's still quite a lot of work to be done: >>> - use pretty-print in the slim RTL dumping >>> - move the escaped-string printing into pretty-print >>> - make the basic block content dumping a cfghook >>> - make these dumps work for GIMPLE also >>> >>> For the moment, this is a good starting point. >>> >>> Obviously there are no changes in code generation due to this patch, >>> so IMHO this patch (and the rest of the series) should be safe for >>> stage3. Hopefully everyone else agrees :-) >>> >>> Bootstrapped&tested on powerpc64-unknown-linux-gnu. OK for trunk? >> >> Hmm, you are removing an (appearant) abstraction that I didn't know was >> there but remember to have asked for in the thread for dumping a late >> callgraph for Ada purposes. Is the abstraction not working or was it simply >> a hassle to keep the VCG path working (I don't thjnk I have ever seen a >> VCG consumer ... ;)). > > I'm not sure what abstraction you mean. If you're talking about the > old graph.[ch], there's nothing abstract about it, it only dumps an > RTL CFG and, indeed, that wasn't working properly.
Ah, ok - maybe it was my wishful thinking when glancing over the patch and see -static void draw_edge (FILE *, int, int, int, int); ;) > The dumps were ugly > if they work at all. Each insn was dumped as a separate node and there > was no option to dump complete translation units to a single file (my > dumper does that just fine, it dumps each CFG as a disjoint subgraph). > (Some examples of what the dumps look like are attached to this > e-mail: http://gcc.gnu.org/ml/gcc-patches/2012-11/msg01977.html) > > A generic graph dumping interface would be nice (graph_traits?) but > for the moment I'm just trying to make a debugging tool available. > > >> Btw, I of course have my own CFG dumper (producing graphviz input) >> in my local tree - attached for reference (I'm simply using it from >> gdb sessions). > > I'll integrate this in my work for a follow-up patch. Well, if you'd > OK the one from this thread first, of course ;-) Ok! Thanks, Richard. > Ciao! > Steven