why can not __builtin_return_address() be made *never* inline and use current level+1 to get the return address of the function of interest. For any stack introspection, having 1 more level will not hurt functionality.
given its explanation below— Built-in Function: void * __builtin_return_address (unsigned int level)
This function returns the return address of the current function, or of one of its callers. The level argument is number of frames to scan up the call stack. A value of
0yields the return address of the current function, a value of1yields the return address of the caller of the current function, and so forth. When inlining the expected behavior is that the function returns the address of the function that is returned to. To work around this behavior use thenoinlinefunction attribute.