Embedded Linux Tutorial 10/11
Overview
Maybe debug tools are weakness of embedded Linux development. But it is quickly developing and there are many tools available for the development purpose.
GDB, The GNU Project Debugger, is the most important symbolic debugger for Linux. In order to use symbolic debug feature, the developer has to enable it during building the project with compiler option -g or -ggdb. And a gdb server should be installed in host or embedded target depends on the configuration. However GDB debugging requires a lot of resource in memory and network bandwidth. When the debug session finished, the symbolic information must be removed from the image file and download to the embedded systems.
The GDB is basically a command line program, but a lot of graphic user interface based GDB can be easily found. For example, DDD, KDevelop and IDEs mentioned before.
Trace
GDB is powerful in removing bugs in specific software. But Trace is much powerful for monitoring the interactivity between application software and kernel.
strace is a system call tracer, i.e. a debugging tool which prints out a trace of all the system calls made by another process/program.
The Linux Trace Toolkit catalogs system events in minute detail, and allows a user to determine exactly what is transpiring on his system.
Performance Analysis
Profiler
Profiling allows you to learn where your program spent its time and which functions called which other functions while it was executing. This information can show you which pieces of your program are slower than you expected, and might be candidates for rewriting to make your program execute faster. It can also tell you which functions are being called more or less often than you expected. This may help you spot bugs that had otherwise been unnoticed.
gprof, the GNU profiler.
gcov, is a tool you can use in conjunction with GCC to test code coverage in your programs.
About /proc
Kernel reveal internal data structure and information about system. The developer requires procps (ps and top) suites to retrieve information from /proc virtual directory. The ps from BusyBox can be used for the embedded systems.
Hardware Tools
In Linux or latest microprocessor development, JTAG/BDM tools are required. Most of the starter kit, reference board will reserve JTAG socket on board. Here are some open source hardware tools for your reference.
An ARM Wiggler compatible JTAG tools.
An Open JTAG project Wiki site. You can find useful information in this site.
Yet another JTAG board, based upon FTDI USB chip.
- allankliu's blog
- 895 reads





Post new comment