At my last job (legacy FORTRAN 77 code), we had files of cross references that list what subroutines called other subroutines, in what files subroutines were defined, what common blocks held what variables, what subroutines included what common blocks, etc. These were then used by shell scripts that grepped the cross reference files and would tell you things about the design of the program.
I'm now at a new company (C++ code), and I've found ctags to replace some of that functionality. The one thing I miss the most is a command we called "who.calls" that lists what subroutines (I mean functions or methods, gotta get used to the OO-speak) call a given subroutine. For example, if the subroutine foo
calls the subroutine bar
:
>who.calls bar
foo
Any suggestions for how to do this without re-engineering the programming environment from my old company? I'm looking for a super regex or some other method that I can use at the command line, but I'm open to other methods that take some totally different approach to give me the same information. I basically want to discover a debug function stack without running the debugger.