Development environment: AT91SAM9X25 Development Board: Install linux2.6.39;
PC Virtual machine: Linux version 2.6.18-194.el5 (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)), ARM-LINUX-GCC version 4.4.3
First, download GBD http://ftp.gnu.org/gnu/gdb/, I downloaded the gdb-6.8.
Second, installation
(1) Decompression: Tar zxvf gdb-6.8a.tar.gz
(2) Configure the installation GDB:
CD gdb-6.8
./configure--target=arm-linux
Make
Make install
(3) Configure the installation Gdbserver:
CD GDB
CD Gdbserver
./configure--target=arm-linux--host=arm-linux
CC =/USR/LOCAL/FRIENDLYARM/TOOLSCHAIN/4.4.3/BIN/ARM-LINUX-GCC
The value of CC is the path of ARM-LINUX-GCC, which can be located by which ARM-LINUX-GCC command. Please refer to the previous blog post for ARM-LINUX-GCC installation.
Make
With the above commands, GDB installation has been completed. (Please continue down ....) )
Three, small test sledgehammer
(1) Write the test program under the virtual machine test.c, compile arm-linux-gcc-g-o test test.c
(2) Copy the test generated in GDB and (1) from the Gdbserver folder to the working directory of the Development Board.
(3) Open minicom under the PC virtual machine, the current working directory of the Development Board is entered./gdbserver 192.168.1.110:55555 test. Tried as if the IP address here seems to be able to write casually, Port 55555, feel free to write, should be greater than 1024.
At this point, you may receive the following error: Error in loading shared Libraries:libthread_db.so.1:cannot open Shared object file:no such file or Directo Ry
Resolution Step:<1> Locate the ARM-LINUX-GCC installation directory under the virtual machine, in/usr/local/friendlyarm/toolschain/4.4.3/arm-none-linux-gnueabi/ Lib to find the libthread_db-1.0.so file.
<2> Copy the file to the/lib folder in the Development Board, open the terminal in this directory, enter ln-s libthread_db-1.0.so libthread_db.so. 1.
(4) The Development Board is entered as follows:
(5) Under the virtual machine, enter the following:
Where 192.168.1.110 is the IP address of the Development Board. Make sure that the board and the virtual machine can be ping-through.
(6) The presence of remote debugging from host 192.168.1.220 in the Development Board indicates that GDB cross-compilation can be used. Enter the command under GDB C,test_arm will be the program.
Installation of the Arm-linux GDB debugging tool