addr2line

addr2line命令使用

南笙酒味 提交于 2020-01-15 16:02:54
Addr2line 工具(它是标准的 GNU Binutils 中的一部分)是一个可以将指令的地址和可执行映像转换成文件名、函数名和源代码行数的工具。这种功能对于将跟踪地址转换成更有意义的内容来说简直是太棒了。 要了解这个过程是怎样工作的,我们可以试验一个简单的交互式的例子。(我直接从 shell 中进行操作,因为这是最简单地展示这个过程的方法,如清单 4 所示。)这个示例 C 文件(test.c)是通过 cat 一个简单的应用程序实现的(也就是说,将标准输出的文本重定向到一个文件中)。然后使用 gcc 来编译这个文件,它会传递一些特殊的选项。首先,要(使用 -Wl 选项)通知链接器生成一个映像文件,并(使用 -g 选项)通知编译器生成调试符号。最终生成可执行文件 test。得到新的可执行应用程序之后,您就可以使用 grep 工具在映像文件中查找 main 来寻找它的地址了。使用这个地址和 Addr2line 工具,就可以判断出函数名( main )、源文件(/home/mtj/test/test.c)以及它在源文件中的行号(4)。 在调用 Addr2line 工具时,要使用 -e 选项来指定可执行映像是 test 。通过使用 -f 选项,可以告诉工具输出函数名。 下面在全志A20平台介绍使用addr2line命令使用方法 1.打开调试宏 将下面红色部分的return NULL屏蔽

Why addr2line is not able to resolve certain address to function names?

天大地大妈咪最大 提交于 2020-01-05 09:34:44
问题 I have backtraces obtained from executing the command dumpheap -n <PID> <file> . I have to convert these address to function names and line numbers to make these backtraces meaningful. I used addr2line to convert these addresses to function names. This is the command i used addr2line -C -f -e <libname>.so <address> . There are certain places where addr2line gives me $t in the place of function names but gives the filename:linenumber correctly. How should i resolve this '$t' into function name

Is there a library call to addr2line? [closed]

那年仲夏 提交于 2019-12-30 01:54:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I need to get the information provided by addr2line (file and line from backtracing a function call) from within a C++ program. Is there a library call similar to addr2line? edit: I am working in a Linux environment. I know I can call addr2line directly and I know that I can use the source code of addr2line in

How to use the addr2line command in Linux?

我们两清 提交于 2019-12-17 05:40:59
问题 I am trying to use addr2line command in Unix but everytime it is giving the same output as ??:0. I am giving command as addr2line -e a.out 0x4005BDC . I got this address while running this a.out executable with valgrind tool to find the memory leakage. I also compiled the source code with -g option. 回答1: You can also use gdb instead of addr2line to examine memory address. Load executable file in gdb and print the name of a symbol which is stored at the address. 16 Examining the Symbol Table.

How to get Crash Point in Java code

雨燕双飞 提交于 2019-12-10 18:28:53
问题 My application has android-support-v4.jar in /libs only. I do not use other library. My application is crashing with SIGNAL 11 error. I want to use addr2line utility of android-ndk. Can we find the function and line number of java file using this tool? Any help will be very helpful here My application is writing to Bluetooth Socket and in between i am closing the socket I suspect, the error is coming because write() is called after close() of socket But I am not able to find exact line or

arm-linux-androideabi-addr2line使用

纵然是瞬间 提交于 2019-12-10 14:28:26
debug的时候,经常遇到类似 Fatal signal 11 (SIGSEGV) at 0x2f64699f 如果是so文件有问题,可以使用addr2line来定位,addr2lien的路径类似如下: android-sdk-windows\ndk-bundle\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin 使用 arm-linux-androideabi-addr2line -C -f -e libXXX.so 2f64699f 输出结果类似: /home/hanfoo/code/test/addr2line/test1.c:5 结果中有文件名,有行号 问题 输出??:0 If the file name or function name can not be determined, addr2line will print two question marks in their place. If the line number can not be determined, addr2line will print 0. 摘自http://linuxcommand.org/man_pages/addr2line1.html 下面转自http://kukuqiu.iteye.com/blog

How to use addr2line in Android

匿名 (未验证) 提交于 2019-12-03 01:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am stuck with my app, as I am unable to debug as it is a multithreaded one and crashes with error SIGSEGV. I get lot of information from LogCat, which gives me addresses in my native library. It would be helpful if I could convert these addresses into my code. Does anybody have any idea how to use addr2line, which is provided with android-ndk? 回答1: Let's say that logcat show you the following crash log (this is from one of my projects): I/DEBUG ( 31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG ( 31): Build

addr2line on kernel module

匿名 (未验证) 提交于 2019-12-03 01:49:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to debug kernel module. I suspect to have there some memory leaks. To check it I have prepared build with enabled Memory leak debugging for kernel and modules. And I got some warning from that: [11839.429168] slab error in verify_redzone_free(): cache `size-64': memory outside object was overwritten [11839.438659] [ ] (unwind_backtrace+0x0/0x164) from [ ] (kfree+0x278/0x4d8) [11839.447357] [ ] (kfree+0x278/0x4d8) from [ ] (some_function+0x18/0x1c [my_module]) [11839.457214] [ ] (some_function+0x18/0x1c [my_module]) from [ ] (some

Android 开发常用方法及命令

匿名 (未验证) 提交于 2019-12-02 23:40:02
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/myvest/article/details/91411708 1、APK常用调试命令 am命令 dumpsys 命令 pm命令 其他常用命令 2、堆栈相关 addr2line gdb配合core dump调试 打印堆栈 3、系统层面的调试命令 dumpsys bugreport cat命令看节点信息 top和free查看cpu和内存情况 1、APK常用调试命令 am命令 1)启动某个apk 启动的方法为 am start -n 包(package)名/活动(activity)全路径 比如: am start -n com.android.music/com.android.music.VideoBrowserActivity 或者am start -n com.android.music/.VideoBrowserActivity am start -a action 可以指定action来启动apk 但你不知道activity时, monkey -p 包名 1 ,也可以启动apk 2)发送指定广播: am broadcast -a xxx广播 如开机广播: am broadcast -a android.intent.action.BOOT_COMPLETED dumpsys 命令

glibc function to retrieve current executable name?

烂漫一生 提交于 2019-11-30 05:03:45
i'm wondering if there is a glibc function that i can use from gcc/g++ that will retrieve the current executable. The purpose of this is to provide the -e argument to addr2line as shown in this answer In standard C and glibc, you have argv[0]: int main (int argc, char *argv[]) the first element of the argv array is the program name. However it's not necessarily enough on its own to determine where exactly the executable is. The argument is actually set by the program that ran your program - be it a shell or a window manager - and they aren't terribly helpful. If your program is in the path and