c - how to find funcation name based on address in library -


i'm printing stacks c code using backtrace_symbols() (following instructions on http://www.gnu.org/software/libc/manual/html_node/backtraces.html). however, can addresses of stack frames in dynamic library though built library using -g -rdynamic .

now, have running process , have library, how find out method each frame address corresponds to? thank in advance.

this on 64bit linux.

the example of print out looks this:

obtained 9 stack frames. /tmp/libexample.so [0x2aaabaae9771] /tmp/libexample.so [0x2aaabaae9828] /tmp/libexample.so [0x2aaabaaa8138] /tmp/libexample.so [0x2aaabaab2402] /tmp/libexample.so [0x2aaabaabd029] /tmp/libexample.so [0x2aaabaa1e23a] /tmp/libexample.so [0x2aaabaa24ded] /lib64/libpthread.so.0 [0x30b700677d] 

i think you're looking dladdr function.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -