0

I would really like to know if there are any methods or applications which can show me which functions are referencing which functions. So say I would like to see from where a function change_state() is called/referenced, I get something like:

                  /--app_init()<--main()
                  |
change_state() <--|
                  |
                  \--afile.c |<--trigger() 
                  /  line 100| 
                  |  line 156|
                  |
                  \--bfile.c|
                     line 26|<--|--button_event()<--process_event()
                     line 30|   |
                                \--move_event() 

EDIT: I am using the Keil compiler in Windows 7.

chwi
  • 2,752
  • 2
  • 41
  • 66

1 Answers1

1

You can use gperf for that type of use.

It will show you a call graph, which is basically what you want, including performance mesurement.

First, assuming you're using gcc, compile with the option -gp.

Then, run your binary normally. It will output a gmon.out file. You can then use gperf to analyse that file, which contains the data you're requesting.

blue112
  • 52,634
  • 3
  • 45
  • 54