Hello. I am trying to understand and modify a very complex program written by others. There are many files, classes and member functions within each class. I have found the member function of interest. Now, I want to know which other functions (i.e. callers) call it. Is there a way to do it? Thanks.
Comments
> Is there a way to do it?
If you want to know this while debugging, do the following:
- put a breakpoint at the function you are interested in
- let the program run to the breakpoint
- view the call stack. The call stack will show the caller of the function
Have fun, as the call stack is a great debugging tool!
Bilderbikkel
[code]void some_function(int x, int y, void(*caller)(void)
{
...
}
void some_caller_func ()
{
some_function(1, 2, some_caller_func);
}[/code]
That way you can watch the function pointer passed and get the address to the caller function.
Perhaps you might try finding a suitable one.
See ya, Bilderbikkel