0

I type the following command in the command line in order to generate control 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

Arasteh
  • 21
  • 2
  • 3

2 Answers2

0

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

Community
  • 1
  • 1
Kulwant Singh
  • 121
  • 2
  • 12
0

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.

Tony Delroy
  • 102,968
  • 15
  • 177
  • 252