Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Function call history in debugger

pDs
Beginner
410 Views

Greetings,

I'm currently working with an extensive code (>200k source lines) and I wanted to trace the function call history right from main! I investigated a few options on stack overflow [1], [2]. The former seemed to suggest that I need to put a breakpoint at every function and then redirect the output in gdb. But this just creates a list of all the functions defined as opposed to the call history. The latter seems to be the case where a breakpoint is set at a given command (creating a pop up).

What I want however is a list of functions (listed by call order). How could I use gdb-ia to get the function call history for the code? Is it even possible for fortran binaries ?

Best Regards,
Pranav

0 Kudos
1 Reply
jimdempseyatthecove
Honored Contributor III
410 Views

I am not aware of any debugger function to do this (which doesn't mean it doesn't exist). Have you explored VTune options. VTune does have call history capability, but I do not  know for sure if it catches all such calls, and of course it will not catch calls not made. You might also look at the documentation for Intel Inspector.

In addition to call stack information, it may be nice to also have (for a specific run scenario) the count of calls for each same call stack.

There may be a source code analyzer that can parse your files (static analysis). If VTune or Inspector does not help, try searching sourceforge.net. Example of google search:

    static "call stack" analysis Fortran site:sourceforge.net

This link may be useful (possibly too usefule): https://openspeedshop.org/

Jim Dempsey

0 Kudos
Reply