Use of the addr2line command in Android debugging

Source: Internet
Author: User

Debugging: Use of the addr2line command in debugging.
Cause: After i850 WiFi is enabled, rootfs restarts when Goole maps is used. The printed log information is as follows:
//////////////////////////
I/debug (3411 ): ***************************************
*********
I/debug (3411): Build fingerprint:
'Prowave/i850/i850/: eclair/eng. zhangjiejing.201002.16.113200: Eng/test-keys'
I/debug (3411): PID: 3436, TID: 3475 >>>> system_server
<
I/debug (3411): Signal 11 (SIGSEGV), fault ADDR 00000000
I/debug (3411): R0 26ba7eec R1 403f3c49 R2 e98cf6f4 R3 405e58ae
I/debug (3411): R4 00000000 R5 00000000 R6 4229b6cc R7 48fecec8
I/debug (3411): R8 490ecd84 R9 48feceb4 10 48fece9c FP 00314d30
I/debug (3411): IP ad3527cd SP 490ecd68 LR ad3527eb PC
00000000 CPSR 00000010
I // system/bin/dhcpolycrystalline (3673): wlan0: Looping
I // system/bin/dhcpcd (3673): wlan0: signal_fd: 4, FD: 5
I/activitymanager (3436): starting activity: intent {
Act = Android. Intent. Action. Main cat = [Android. Intent. Category. Home]
Flg = 0x10200000 CMP = com. Android. launcher/. launcher}
D/locationmanager (3777): removeupdates: Listener = P. A @ 43da64b8
I/debug (3411): #00 PC 00000000
I/debug (3411): #01 PC
000527e8/system/lib/libandroid_runtime.so
I/debug (3411): #02 PC restart f1f4/system/lib/libdvm. So

I/debug (3411 ):
I/debug (3411): code around LR:
I/debug (3411): ad3527d8 69e19806 694c9000 1c191c10 9b059a04
I/debug (3411): ad3527e8 b00247a0 46c0bd10 00017868 00006728
I/debug (3411): ad3527f8 4c0fb570 447c4d0f 6b2e1965 d1112e00
I/debug (3411 ):
I/debug (3411): Stack:
I/debug (3411): 490eb7 00000013
I/debug (3411): 490ecd2c ad05f661/system/lib/libdvm. So
I/debug (3411): 490ecd30 running c2aec/Dalvik-linearalloc (Deleted)
I/debug (3411): 490e34ad0560f7/system/lib/libdvm. So
I/debug (3411): 490ecd38 400292d8/mspace/Dalvik-heap/zygote/0
(Deleted)
I/debug (3411): 490ecd3c unzip c2aec/Dalvik-linearalloc (Deleted)
I/debug (3411): 490e40-000003dc
I/debug (3411): 490e44ad0591f5/system/lib/libdvm. So
I/debug (3411 ):
490ecd48 42200d44/data/Dalvik-Cache/system @ classes. Dex
I/debug (3411 ):
490ecd4c 42200d44/data/Dalvik-Cache/system @ classes. Dex
I/debug (3411 ):
490ecd50 4232b87d/data/Dalvik-Cache/system @ classes. Dex
I/debug (3411): 490ecd54 00000000
I/debug (3411 ):
490ecd58 4264aa04/data/Dalvik-Cache/system @ classes. Dex
I/debug (3411): 490ecd5c export c1cbc/Dalvik-linearalloc (Deleted)
I/debug (3411): 490ecd60 df002777
I/debug (3411): 490ecd64 e3a070ad
I/debug (3411): #01 490ecd68 43160000
I/debug (3411): 490ecd6c ad05f661/system/lib/libdvm. So
I/debug (3411): 490ecd70 490ecda8
I/debug (3411): 490ecd74 ad00f1f8/system/lib/libdvm. So
W/activitymanager (3436): Activity pause timeout
Historyrecord {43d6cd48
Com. Google. Android. Apps. Maps/COM. Google. Android. Maps. mapsactivity}
Wait for FB sleep enter
D/wifiservice (3436): releasewifilocklocklocked:
Wifilock {networklocationprovider type = 2
Binder = Android. OS. Binder @ 43bfb998}
Binder: Release 3436: 3560 transaction 22233 in, still active
Binder: Send failed reply for transaction 22233 to 3777: 3777
I/debug (3411): debugadh committing suicide to free the zombie!
I/debug (3855): debugadh: Apr 14 2010 14:24:22
I/servicemanager (2066): Service 'usagestats' died
I/servicemanager (2066): Service 'account' died
//////////////////////////
Note that the red part is the Program Execution
Row stack! Obviously, the value of the first PC pointer is 0, that is, the PC pointer is null. This is the problem.
The next step is to locate this problem. As mentioned above, this is the stack for program execution, so #01 PC
000527e8/system/lib/libandroid_runtime.so
This address is the scope of the problem we are looking for, because it is obvious that the latter first goes into the stack, so it is clear that the former includes the latter, use the following command to locate the source code with the address:

CPP @ CPP :~ /R7_0422 $
../Gcc-4.1.2-glibc-2.5-nptl-3/ARM-None-Linux-gnueabi/bin/arm-none-linux-gnueabi-addr2line
-E
Out/target/product/i850/Symbols

/System/lib/libandroid_runtime.so
000527e8
Frameworks/base/CORE/JNI/android_location_gpslocationprovider.cpp: 397
CPP @ CPP :~ /R7_0422 $

The first line of the source code is a function, so 000527e8 is the input of this function.
Port address. Next, PC 000000
The corresponding call should be within the function. We can see that this function is only called for another function pointer, so we can conclude that the value of this function pointer is null, apparently, calling an empty pointer function is
Incorrect. So you need to assign a value to this function pointer earlier to solve the problem!

Some additional information about addr2line:
If the executable file does not contain debugging symbols, you will get ?? : 0 as the response.
The readelf command in Linux can also read information about executable files. For example, if there is an executable file AA. Elf, it can be used as follows: readelf
-H aa. Elf parameter-H reads the head information of the executable file.
Reference connection: http://www.xxlinux.com
/Linux/article/accidence/technique/20070125/7209 .html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.