如何在libc.so中查找函数名称

问题描述 投票:0回答:1

在我的应用程序中,我们在运行时遇到了一些阻碍。因此我们在这段时间内进行了追溯。查找libc.so中存在的函数。但是这里只显示地址。我们如何找出确切的功能?

回溯字符串:

/run/media/mmcblk3p1/xlplus(WDMainSigHandler+0x25) [0x522ee2]
/lib/libc.so.6(+0x28980) [0x7692f980]
/lib/libc.so.6(+0x1ac46) [0x76921c46]
linux libc backtrace
1个回答
0
投票

我们如何找出确切的功能?

有几种常见的方法:

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

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
© www.soinside.com 2019 - 2024. All rights reserved.