views:

41

answers:

1

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------
+2  A: 

gcc itself can do it.

Ignacio Vazquez-Abrams
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.
Job