Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate program dependence graph for C program?

I want to generate a Program Dependence Graph (PDG) from C source code. I found papers that explain how do it, but all used the commercial CodeSurfer tool.

Are there any free tools that do this?

like image 381
user1014814 Avatar asked Oct 26 '11 15:10

user1014814


2 Answers

Frama-C is an open-source static analysis framework that can compute a sound Program Dependency Graph for C programs. Its slicing plug-in uses the resulting PDG. The slicing and PDG computation were discussed in February 2010 on the mailing list (messages from jung, myung-jin and their answers).

You may also look at NIST's Unravel, or Georgia Tech's Aristotle. Both Valsoft at Karlsruhe University, and Loyola's Surgeon's Assistant, might also be worth looking into.

like image 59
Pascal Cuoq Avatar answered Oct 03 '22 03:10

Pascal Cuoq


There's a promising new tool called cpp-depenencies.

It can generate component dependency diagrams (like below) as well as class hierarchy diagrams (by passing an option to treat each source file as a component).

enter image description here

like image 44
thegreendroid Avatar answered Oct 03 '22 05:10

thegreendroid