addr2line

glibc function to retrieve current executable name?

匆匆过客 提交于 2019-11-29 02:49:42
问题 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 回答1: 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

android死机堆栈调试方法

怎甘沉沦 提交于 2019-11-27 10:15:26
这两种方法都不是我发明了,都是网上一些高手公共出来的调试方法,无奈找不到出处的地方了,所以就在此总结一下,以方便android下的调试: 简要说明: android系统中调试Java非常容易,一般遇到错误都在logcat中打印出错时函数的调用关系, 而C库中出错时只看到一些二进制信息,使用gdbserver调试环境搭建又比较复杂。 方法一: 下在介绍一个简单的调试库的方法,当然需要有so库的源代码 举例 a) 错误信息如下,它表示了出错时的函数调用关系(下面调上面的) I/DEBUG ( 634): #00 pc 000078e6 /system/lib/libmultiplayerservice.so I/DEBUG ( 634): #01 pc 000087bc /system/lib/libmultiplayerservice.so I/DEBUG ( 634): #02 pc 0000e94e /system/lib/libsensorservice.so I/DEBUG ( 634): #03 pc 0000a790 /system/lib/libsensorservice.so I/DEBUG ( 634): #04 pc 0000d4b2 /system/lib/libsensorservice.so I/DEBUG ( 634): #05 pc 0000d852

How to use the addr2line command in Linux?

和自甴很熟 提交于 2019-11-26 21:43:22
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. 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 . (gdb) info symbol 0x4005BDC Please check: Whether all the functions in your binary are compiled with -g ,

How to use addr2line in Android

本小妞迷上赌 提交于 2019-11-26 01:48:29
问题 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): *** *** *** *** *** *** *** *** *** ***

How to use addr2line in Android

可紊 提交于 2019-11-25 23:33:06
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? 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 fingerprint: 'generic/sdk/generic:2.3/GRH55/79397:eng/test