Android call stack Tracing

Source: Internet
Author: User

In common C/C ++ code, you can respond to the segmentation fault error caused by improper memory operations, that is, the signal SIGSEGV (11. You only need to set the handler of SIGSEGV in the program, call the backtrace of libc, and output the corresponding stack information. The problem will soon be found. However, in Android, bionic does not provide similar functions, and the log information is a logger that can be seen through logcat. However, Android also outputs log information, as shown below:

 

View plaincopy to clipboardprint?
  1. 02-08 10:36:32. 076: INFO/debug (1261): PID: 1959, TID: 1959 >>> Android. Radio <
  2. 02-08 10:36:32. 076: INFO/debug (1261): Signal 11 (SIGSEGV), fault ADDR 00198080
  3. 02-08 10:36:32. 076: INFO/debug (1261): R0 00198080 R1 81116dac R2 ffffffea R3 00000000
  4. 02-08 10:36:32. 086: INFO/debug (1261): R4 8111a9f0 R5 0000000a R6 00000888 R7 0000000a
  5. 02-08 10:36:32. 086: INFO/debug (1261): R8 735f6d66 R9 525f6474 10 4154bcd8 FP 00000000
  6. 02-08 10:36:32. 086: INFO/debug (1261): IP a0000000 SP bec1a300 LR 81112561 PC 81109124 CPSR 80010010
  7. 02-08 10:36:32. 306: INFO/debug (1261): #00 PC 00009124/system/lib/libfmradio_jni.so
  8. 02-08 10:36:32. 306: INFO/debug (1261): #01 PC 0001255c/system/lib/libfmradio_jni.so
  9. 02-08 10:36:32. 306: INFO/debug (1261): #02 PC route c93e/system/lib/libfmradio_jni.so
  10. 02-08 10:36:32. 316: INFO/debug (1261): #03 PC restart ae14/system/lib/libfmradio_jni.so
  11. 02-08 10:36:32. 316: INFO/debug (1261): #04 PC route 8a72/system/lib/libfmradio_jni.so
  12. 02-08 10:36:32. 316: INFO/debug (1261): #05 PC route 6c22/system/lib/libfmradio_jni.so
  13. 02-08 10:36:32. 326: INFO/debug (1261): #06 PC route 4d92/system/lib/libfmradio_jni.so
  14. 02-08 10:36:32. 326: INFO/debug (1261): #07 PC release e434/system/lib/libdvm. So

 

 

The binary code is placed in the mobile phone, and the size is taken into consideration, removing the matching information. However, we can use the binary file generated during compilation to obtain its symbolic information and obtain the call Stack:

View plaincopy to clipboardprint?
  1. Yang @ Ubuntu $ src/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-addr2line-f-e src/out/target/product/pnx6715_refd/symbols/system/lib/libfmradio_jni.so limit 960c 000129ec 0000 cdce listen b2a4 00009496 00008258 10954f6
  2. Non_congruent
  3. Bionic/libc/arch-arm/bionic/memcpy. S: 229
  4. _ Sfvwrite
  5. Bionic/libc/stdio/fvwrite. C: 151
  6. _ Sprint
  7. Bionic/libc/stdio/vfprintf. C: 71
  8. Printf
  9. Bionic/libc/stdio/printf. C: 44
  10. Fm_std_power
  11. Frameworks/base/fmradio/JNI/.../external/.../fmradio/fmapi/fm_std_api.c: 144
  12. _ Z11fm_switchonv
  13. Frameworks/base/fmradio/JNI/fm_functions.cpp: 95
  14. Radio_switchon
  15. Frameworks/base/fmradio/JNI/native. cpp: 41
  16. Yang @ Ubuntu $ C ++ filt _ z11fm_switchonv
  17. Fm_switchon ()

 

 

In this way, you can obtain the call stack information and find out the problem.

 

Android call stack trace, Android call stack parsing, Android print call stack, Android native C call stack

 

 

Original article: native code SIGSEGV debugging in Android-call stack Parsing

From: bytes

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.