A
Alessandro Basili
Dear all,
I have been looking for a way to print the function name (as I name it
in my source code) via the function pointer.
I have been asking the "oracle" (i.e. google) and a lot of forums
suggested a very broad range of semi-solutions through ldaddr (not POSIX
and using dynamic linking) or backtrace and some braver ones which
attempted to "maintain" a table of pointers and names.
Did anybody ever find a more elegant (and portable) solution?
p.s.: __func__ is not what I'm looking for, since it is defined when
entering the function.
I have been looking for a way to print the function name (as I name it
in my source code) via the function pointer.
I have been asking the "oracle" (i.e. google) and a lot of forums
suggested a very broad range of semi-solutions through ldaddr (not POSIX
and using dynamic linking) or backtrace and some braver ones which
attempted to "maintain" a table of pointers and names.
Did anybody ever find a more elegant (and portable) solution?
p.s.: __func__ is not what I'm looking for, since it is defined when
entering the function.