This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How to find function name from function pointer?
- From: "Gaurav Jain" <gaurav dot anywhere at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Cc: "Priyank Choudhury" <priyank dot choudhury at gmail dot com>
- Date: Mon, 4 Jun 2007 19:14:09 +0530
- Subject: How to find function name from function pointer?
Hi,
I need to find the name of a function given the function pointer
(programmatically) at run-time. I have used dladdr() to obtain the
library name but I'm not able to obtain the function name using that.
I have used addr2line to obtain the function name using the function
pointers but it is not giving any values.
Does gcc provide any mechanism using which I can achieve the above.
I'm using gcc version 4.1 on Linux.
Thanks,
Gaurav