Ganesh T
Ganesh T

Reputation: 11

How to find out function name in libc.so

In my application we are getting some blocking in run time. So we taken a back-trace during that time..
Looks the function present in libc.so. But here it showing only address. How can we find out exact function?

Back-trace Strings:

/run/media/mmcblk3p1/xlplus(WDMainSigHandler+0x25) [0x522ee2]
/lib/libc.so.6(+0x28980) [0x7692f980]
/lib/libc.so.6(+0x1ac46) [0x76921c46]

Upvotes: 1

Views: 839

Answers (1)

Employed Russian
Employed Russian

Reputation: 213375

How can we find out exact function?

There are few common ways:

addr2line -fe /lib/libc.so.6 0x28980 0x1ac46

or

gdb -q /lib/libc.so.6
(gdb) x/i 0x28980  # will show which function you are in, and the actual instruction
                   # You may need to examine a few instructions before to make sense of it:
(gdb) x/20i 0x28980-35

(gdb) info symbol 0x1ac46  # ~equivalent to addr2line

Upvotes: 2

Related Questions