How to Use arm-linux-androideabi-addr2line [go to http://blog.csdn.net/hun_sunny/article/details/8350151]

Source: Internet
Author: User
How to Use arm-linux-androideabi-addr2line how to use arm-linux-androideabi-addr2line reproduced address: http://blog.csdn.net/yanzheng1113/article/details/8148091

1. Add the path of the arm-linux-androideabi-addr2line executable file in ndk to the configuration file ~ /. Bashrc, for example:

Export Path = $ path :~ /Dlna/android-ndk-r6b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin

 

2. Make the configuration take effect: Source ~ /. Bashrc

 

3. Use tools. Example: arm-linux-androideabi-addr2line-C-f-e ~ /Workspace/dlna/libs/armeabi/libctrlpt. So 0003deb4

Where, 0003deb4 is the Pc value in the stack information.

 

 

Debugging method for Android application crash

There are two methods to analyze the stack information of crash.

1 Google provides a Python script from

Http://code.google.com/p/android-ndk-stacktrace-analyzer/
Download the Python script and use ADB logcat-D> logfile to export the crash log,
Use arm-Eabi-objdump to be located under build/prebuilt/linux-x86/arm-eabi-4.2.1/bin
Convert so or EXE to assembly code, for example, arm-Eabi-objdump-s mylib. So> mylib. ASM,
Script

Python parse_stack.py <ASM-File> <logcat-File>

2 directly use the arm-linux-androideabi-addr2line below ndk

(D: \ android-ndk-r8 \ toolchains \ arm-Linux-
Androideabi-4.4.3 \ prebuilt \ windows \ bin \ arm-linux-androideabi-addr2line.exe)

Example: arm-linux-androideabi-addr2line-C-f-e libxxx. So 0x ##### (address)

 

Android debugging tool addr2line

Use addr2line to track bugs in its own dynamic library (so file:
Solved ?? : 0. The number of lines in the source code cannot be displayed.

In the Android. mk file:

Java code
  1. Local_cflags: =-d1_stdc_constant_macros-wl,-map = test. Map-G

Add two compilation parameters-wl,-map = test. Map-G.
Added GCC warning and debugging flag

Arm-linux-androideabi-addr2line-C-f-e/project directory/obj/local/armeabi/libfaa_jni.so 0024362e

Tip: 1. Note that the debugging file is located in the OBJ directory, not the so file generated in the libs directory.
2. 0024362e indicates the location of the error mechanism.

Also:
Add the application. mk file in the JNI/directory, change it to debug mode, and debug app_optim: = debug
For specific application. mk file configuration, see: http://blog.csdn.net/weidawei0609/article/details/6561280

There are two methods to analyze the stack information of crash.

1 Google provides a Python script from

Http://code.google.com/p/android-ndk-stacktrace-analyzer/
Download the Python script and use ADB logcat-D> logfile to export the crash log,
Use arm-Eabi-objdump to be located under build/prebuilt/linux-x86/arm-eabi-4.2.1/bin
Convert so or EXE to assembly code, for example, arm-Eabi-objdump-s mylib. So> mylib. ASM,
Script

Python parse_stack.py <ASM-File> <logcat-File>

2 directly use the arm-linux-androideabi-addr2line below ndk

(D: \ android-ndk-r8 \ toolchains \ arm-Linux-
Androideabi-4.4.3 \ prebuilt \ windows \ bin \ arm-linux-androideabi-addr2line.exe)

Example: arm-linux-androideabi-addr2line-C-f-e libxxx. So 0x ##### (address)

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.