Tools in the Android NDK use

Source: Internet
Author: User

1. Dynamic so processing:

Arm-linux-androideabi-readelf.exe-a xx.so   
Output all functions

To disassemble so packages, use $ (jni_proj_path)/obj\local\armeabi the so package with the symbol table below. Jni_proj_path the root directory of the Jni folder when compiling the so package

2. Static a processing:

Arm-linux-androideabi-ar.exe-t xx.a > Xx.txt
Output. All functions in a. A

Output. All functions in a. A

3. NDK compiles the above two library files, both. A and. So can be compiled directly from the Arm-linux-androideabi-g++.exe tool, and the compilation syntax is consistent with the g++ on Linux. You can also use the Ndk-build command directly!
4. Crash positioning 1) Use Addr2line to translate the address into the number of lines of code,The so entered is a signed table, which is strip:
Arm-linux-androideabi-addr2line.exe-f-E E:\dev_code\Sosomap-old\Sosomap-jni\obj\local\armeabi\libXX.so 000263ae

2) Use Ndk-stack.exe to restore the stack:
Ndk-stack-sym E:\dev_code\Sosomap-old\Sosomap-jni\obj\local\armeabi-dump D:\ANDROID-NDK-R9B-WINDOWS-X86\TXMAP_ Log.txt
-sym is the so path to the signed table, and-dump is the stack information for crash, which must contain:********** Crash Dump: **********
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.