开发者

how to generate control flow graph of a c program by gcc 3.4.5?

I type the following command in the command line in order to generate contr开发者_开发百科ol flow graph for a c program by gcc 3.4.5 but I couldn't find the result files. In addition, how do I see the control flow graph garphicallyy? Thanks


You forgot to include your command-line... I assume -fprofile-arcs. The output file location is described in the gcc manpage:

    ... Each object file's auxname is
    generated from the name of the output file, if explicitly speci-
    fied and it is not the final executable, otherwise it is the base-
    name of the source file. In both cases any suffix is removed (e.g.
    foo.gcda for input file dir/foo.c, or dir/foo.gcda for output file
    specified as -o dir/foo.o).

So, output is written alongside the object files - in their directories. If you compile source directly to an executable, you'll find the profiling output in the directory the compiler wrote the executable to.


Use gcc -fdump-tree-cfg <Source.c> for the control flow graph.

Refer the link for GUI. Geting Control Flow Graph from ANSI C code

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜