For example, there is the source:
void my_special_debugging_function(const char* function_name, const char* file_name, int line_number); void func1() {
See -finstrument-functions in the GCC documentation. You may want to use dladdr() in the debugging function, which may also require linking with -Wl,-export-dynamic.
-finstrument-functions
dladdr()
-Wl,-export-dynamic