What do I want?
I am looking for a way to detect all points in my code where a specific function is called.
Why do I want it?
Some examples:
- Some output comes out sorted or randomized, and I want to know where this happens
- I am considering to change/overload a function and want to know in which part of my code this could have impact
What have I tried?
- I tried placing a breakpoint in the file that was called. This only works for non builtin functions which are called from short running code that always executes everything.
- I tried 'find files', this way I can easily find direct calls to
sort
but it is not so easy to find a call tosort
invoked byunique
for example. - I have tried depfun, it tells me:
- whether something will be called
- from where non-builtin functions will be called
- I thought of overloading the builtin function, but feels like a last resort for me as I am afraid to make a mess. | Edit: Also it probably won't help due to function precedence.
The question
What is the best way to track all potential (in)direct function calls from a specific function to a specific (built-in)function.