I am trying to modify a complex Fortran code for fluid dynamics written by many people which consists of many routines, subroutines, and functions. I wonder if there is an option in gdb or any other debugger or code that can generate a diagram of the routines called when the code is executed with a specific option. I am looking to generate a diagram like this or similar where I can see all the routines and subroutines that were called when executing Fortran the code, so I can have an idea about what routines to modify.
Asked
Active
Viewed 166 times
1

Ian Bush
- 6,996
- 1
- 21
- 27

user3671704
- 161
- 7
-
Which platform? truss and dtrace can show function call traces, but aren’t available everywhere. – Mark Plotnick Mar 16 '22 at 16:59
-
Most profilers, including gprof, can generate a call graph from run time information - https://stackoverflow.com/questions/2439060/is-it-possible-to-get-a-graphical-representation-of-gprof-results might be of use – Ian Bush Mar 16 '22 at 17:17
-
I am running the code on a Mac and Linux server. – user3671704 Mar 16 '22 at 17:33
-
I used to use Understand from https://www.scitools.com/ for diagramming Fortran code bases. Very useful. Costs money. – High Performance Mark Mar 16 '22 at 18:23
1 Answers
2
Rather than use a debugger it would probably be more common to use the output of a profiler - Is it possible to get a graphical representation of gprof results? provides a few suggestions, and below is the output generated by using gprof
and gprof2dot
on one of my own little codes

Ian Bush
- 6,996
- 1
- 21
- 27