gcc - Geting Control Flow Graph from ANSI C code -


i'm building tool testing ansi c applications. load code, view control flow graph, run test, mark vertexes hit. i'm trying build cfg myself parsing code. unfortunately gets messed if code nested. gcc gives ability cfg compiled code. might write parser output, need line numbers setting breakpoints. there way getting line numbers when outputting control flow graph -fdump-tree-cfg or -fdump-tree-vcg?

for control flow graph of c program @ existing python parsers c:

call graphs closely related construct control flow graphs. there several approaches available create call graphs (function dependencies) c code. might prove of progressing control flow graph generation. ways create dependency graphs in c:

the following tools unfortunately require code compilable, because depend on output gcc:

  • codeviz (gpl v2) (weak point: needs compilable source, because uses gcc dump cdepn files)
  • gcc +egypt +dot (gpl v*, perl = gpl | artistic license, epl v1) (egypt uses gcc produce rtl, fails buggy source code, or in case want focus on single file larger project. therefore, not useful compared more robust cflow-based toolchains. note egypt has default support excluding library calls graph, make cleaner.

also, file dependency graphs c/c++ can created crowfood.


Comments