-1

I am debugging C code for embedded systems (backtrace is no option) and I have this repetitive task which consists in putting a printf for each function call to find the real caller of my function in a specific time of code execution.

I am using cscope tool along with CCtree vim plugin to find the callers and it would be really helpful If someone already wrote a vimrc configuration for this or if there is some magical vim plugin that does this.

Santosh A
  • 5,173
  • 27
  • 37
HobbitOfShire
  • 2,144
  • 5
  • 24
  • 41
  • 2
    I know it is not the answer, but it may help. If you are using `gcc`, you don't need to manually add `printf` in each function. By using [`-finstrument-functions`](https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-finstrument_002dfunctions-2112) with `__cyg_profile_func_enter()` and `__cyg_profile_func_exit()`, the program should print the function entry and exit by itself. – SSC Dec 16 '14 at 09:48

1 Answers1

1

You can use the cscope vim plugin from CSCOPE_MAPS.

For more details on using cscope and vim refer cscope and vim

Santosh A
  • 5,173
  • 27
  • 37