Re: using gcc to build a control flow graph

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008/11/3 Tanya Gornak <errizo@xxxxxxxxx>:

> Could you please recommend me a way to extract control flow graph from gcc?

Depending on how much analysis you need to do, you could just request
the basic block boundaries dumped together with the IL using:

$ gcc -fdump-tree-ssa-blocks ...

This gives you a dump right after the program is in SSA form.  The
basic block boundaries can then be post-processed to generate a graph
drawing input file.  Most optimization passes will also accept the
-blocks modifier, so you can produce a CFG out of any pass.

However, if you need to interact with the CFG in deeper ways, then
you'll have to write a proper GCC pass.


Diego.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux