"Android Deep Exploration" tenth chapter experience

Source: Internet
Author: User

The tenth chapter of "Android Deep Exploration" is about the debugging technology of Embedded Linux. For complex Linux drivers and libraries such as HAL, you need to test them in a variety of ways. The use of the PRINTK function is similar to the printf function, except that the PRINTK function runs in kernel space and the printf function runs in user space. In other words, Linux kernel programs like Linux drivers can only output debugging information using the PRINTK function. In Linux file systems,/proc is often used as a tool for data interaction between kernel space and user space. The/proc file system behaves like a device file system (/dev). /proc is a virtual file system, which means that/proc is not a real file system, but a memory map. All read and write/proc are read and write to memory. So reading and writing/proc file systems is much faster than reading/writing/dev file systems. As a result, the/proc file system can also serve as a tool for Linux to interact with user-space programs. Test the GDB, Gdbserver tool for the user space program, and the Kgdb tool for debugging kernel space. GDB can track programs that debug user space. List command 3 ways to call: List;list-;list N.

Through the tenth chapter, I learned that Linux kernel debugging is very difficult, most people prefer to use the PRINTK function directly output debugging information, and do not want to use a variety of commands to debug. By learning the debugging technology of Embedded Linux, we can use one or several of them according to the actual situation when debugging. When you find that a piece of code is too many bugs or is difficult to find through the PRINTK function output information, consider using KGDB to position the bug in step by step mode. The flexibility to use these debugging techniques is fundamental to debugging. These experiences need to be constantly understood in practice.

"Android Deep Exploration" tenth chapter experience

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.