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
  • 698,132
  • 130
  • 858
  • 1,229
Lucas
  • 441
  • 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
  • 740,318
  • 145
  • 1,296
  • 1,325
  • 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