Using the GdB method debugging, because of the limited resources of embedded system, it can not be debugged directly on the target system, which is usually debugged by Gdb+gdbserver. The target system must include the Gdbserver program, and the host must also install the GDB program. Here we are not directly using the Linux distribution with GDB, need to cross compile gdb and gdbserver.
A Objective
Embedded Linux system, in the application development process, in many cases, users need to be repeated debugging an application, especially complex programs. Using the GdB method debugging, because of the limited resources of embedded system, it can not be debugged directly on the target system, which is usually debugged by Gdb+gdbserver. Gdbserver is running on the target system and GDB is running on the host.
The target system must include the Gdbserver program, and the host must also install the GDB program. Here we are not directly using the Linux distribution with GDB, need to cross compile gdb and gdbserver.
Two Compiling GDB and Gdbserver tools
Download the latest version of the gdb-6.8.tar.gz, you can download to ftp://ftp.gnu.org/gnu/gdb.
Prepare your own working directory, as shown below
/home/user/gdb
|--gdb-6.8
|--obj-gdb
|--build
|--obj-gdbserver
|--build
|--bin
The script Obj-gdb/build reads as follows:
#!/bin/sh
.. /gdb-6.8/configure--target=arm-linux--enable-shared--prefix=/usr/src/arm/gdb/build-gdb--without-x-- DISABLE-GDBTK--disable-tui--without-included-regex--without-included-gettext
Make
echo "Done"
The script Obj-gdbserver/build reads as follows:
#!/bin/sh
cc=/opt/toolchain/arm-linux/bin/arm-linux-gcc
.. /gdb-6.8/gdb/gdbserver/configure--host=arm-linux--without-included-regex--without-included-gettext
echo "Done"