Quantcast
Channel: acassis – Alan C. Assis
Viewing all articles
Browse latest Browse all 870

Creating call graph function for C program compiled with GCC

$
0
0

I was looking for a way to see how functions flow in a program.

After some search I found this nice post:

m0agx.eu/2016/12/15/making-call-graphs-with-gcc-egypt-and-cflow/

Then I downloaded egypt-1.10.tar.gz, decompressed it and run:

$ perl Makefile.PL
$ make
$ sudo make install

Then I added this flag: -fdump-rtl-expand to gcc compilation. It created many files.expand at Debug/ directory. The final command was:

$ egypt ./Debug/sources/*.expand ./Debug/sources/ext_monitor_system/*.expand ./Debug/sources/cJSON/*.expand ./Debug/sources/notification/*.expand ./Debug/sources/accessctl_perm_check/*.expand ./Debug/sources/coap_dev_resource/*.expand | dot -Gsize=15000,15000 -Grankdir=LR -Tpng -o /tmp/callgraph.png


Viewing all articles
Browse latest Browse all 870

Latest Images

Trending Articles



Latest Images