1 for complex Linux drivers and libraries such as HAL, it is necessary to debug them using a variety of methods. Examples include setting breakpoints, stepping through code, outputting debugging information, and so on.
2 Print kernel debug information:printk, this function is similar to printf usage, but PRINTK runs in kernel space and printf runs in user space.
The 3PRINTK file is a simple text file with 4 numbers, default value:6 4 1 7
4 using the printk function heavily reduces Linux Drive performance. To facilitate the control of the output of the PRINTK function, it is best to take advantage of the compiler directives in the C language (#if, #else ,#endif)
The 5 printk function displays the message in the console (terminal) through the /dev/console device file. The device file only works under the console of the character interface. So only the console in the character interface can output messages normally.
6 Data interaction through a virtual file system (/proc). /proc is a virtual file system, a memory map, and a bookstore that reads and writes /proc file systems is much faster than reading/writing/ dev file systems.
7 The Read and write of a Linux file is determined by the properties, which can be represented in octal.
8 Delete the virtual directory from the virtual directory before deleting it.
9 Introduction of 2 Debugging Tools, you can trace the code of the program line by row
(1) using gdb,gdbserver can debug user space program
(2) remote debugging kernel space program with Kgdb
My blog Address
http://www.cnblogs.com/zhanghui4521/
Read the experience of "Embedded Linux debugging Technology"