0

Is there any tool to log the execution path of functions that a program goes through? I know gdb can show the backtrace at a particular point. But I want to see the whole story of a program. For instance:

int main(){
    a();
    b();
}
void a(){
    c();
}

The tool gives out something like:

a-----
  c------
b------
Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Lucas
  • 461
  • 1
  • 5
  • 12
  • Is this a program you created? Your options will change depending on if you have the source code or not. – bta Aug 26 '10 at 23:51

1 Answers1

2

gcc itself can do it.

Community
  • 1
  • 1
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • Maybe you could give an example of how to do it. Because getting the name of a function based on its address (which is basically all you get with `-finstrument-functions`) is not a trivial task. – mtvec Aug 27 '10 at 09:46