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:
- pycparser
- pycparser
- pyclibrary (fork of pyclibrary )
- joern
- coflo c/c++ control flow graph generator , analyzer
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:
using cflow:
- cflow +pycflow2dot +dot (gpl, bsd) cflow robust, because can handle code cannot compile, e.g. missing includes. if preprocessor directives heavily used, may need
--cppoption preprocess code. - cflow + cflow2dot + dot (gpl v2, gpl v3, eclipse public license (epl) v1) (note cflow2dot needs path fixing before works)
- cflow +cflow2dot.bash (gpl v2, ?)
- cflow +cflow2vcg (gpl v2 , gpl v2)
- enhanced cflow (gpl v2) list exclude symbols graph
- cflow +pycflow2dot +dot (gpl, bsd) cflow robust, because can handle code cannot compile, e.g. missing includes. if preprocessor directives heavily used, may need
using cscope:
- cscope (bsd)
- cscope +callgraphviz +dot +xdot
- cscope +vim cctree (c call-tree explorer)
- cscope +ccglue
- cscope +codequery c, c++, python & java
- cscope +python html producer
- cscope +calltree.sh
ncc (cflow like)
- kcachegrind (kde dependency viewer)
- calltree
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) (
egyptusesgccproducertl, fails buggy source code, or in case want focus on single file larger project. therefore, not useful compared more robustcflow-based toolchains. note egypt has default support excluding library calls graph, make cleaner.
also, file dependency graphs c/c++ can created crowfood.
Comments
Post a Comment