GDB Remote debugging Android native program

Source: Internet
Author: User

Let's look at a schematic diagram:

I am the Linux and Android Dual 0 Foundation, the current understanding of GDB is very simple. (Note: Commands executed on Android need to be executed under the ADB shell.) )

① Open the command terminal (Ctrl + Alt + T) and enter the ADB shell. Create a new directory in the Android data directory, such as DOG_LD.

② copies the Gdbserver and the program to be debugged from Linux to the Android/data/dog_ld directory.

③ into the Android/data/dog_ld directory and see if the required files are copied successfully.

④ Modify the file permissions.

⑤ starts the program for debugging by Gdbserver in the Android/data/dog_ld directory.

The process ID is the port used by 732,gdbserver is 1234.

⑥ with Ctrl + ALT + T, and then open a Linux command-line window. The 1234 port of Linux is mapped to the 1234 port of Android via ADB ForWord.

⑦ into the Linux source directory under Dog_ld, start the NDK arm-linux-androideabi-gdbtui for remote debugging.

After the ⑧ is started, you can enter a command to debug. The input s represents stepping.

GDB Remote debugging Android native program

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.