Note: The installation path of arm-Linux-GDB is/usr/local/ARM/3.4.1.
1. Compile and install arm-Linux-GDB
Download gdb-6.8.tar.bz2 to the working directory
GDB source code download: http://ftp.gnu.org/gnu/gdb/
The command is as follows:
$ Tar-jxvf gdb-6.8.tar.bz2
$ Gdb-6.8 CD
$./Configure -- target = arm-Linux -- enable-sim -- prefix =/usr/local/ARM/3.4.1
-- Prefix is used to specify the installation path
$ Make
Make encountered the following error:
Configure: Error: No termcap library found
Make [1]: *** [configure-GDB] Error 1
Make [1]: Leaving directory '/home/lining/gdb-6.8'
Make: *** [all] Error 2
Solution: The termcap library file is missing and sudo apt-Get install libncurses5-dev installation is executed on the terminal
$ Sudo make install
You can find the arm-Linux-GDB file in/usr/local/ARM/3.4.1/bin.
2. Compile and install the arm-Linux-gdbserver
Go to./GDB/gdbserver
The command is as follows:
$ Cd gdb/gdbserver./configure -- target = arm-Linux -- Host = arm-Linux
$ Make cc = arm-Linux-gcc
(Cc = arm-Linux-GCC is used to specify the arm-Linux compiler)
Solution to the path_max undeclared error during compilation:
Add in the hostio. c file
# Include <Linux/limits. h>
The reason is that the macro path_max is not defined in <limits. h>, but is defined in <Linux/limits. h>.
(Red indicates that I did not encounter this error during compilation. This error was compiled by netizens and will be left here for future reference)
After compilation is successful, the gdbserver file is generated in the current directory and copied to the Development Board (you can put it in the Development Board/usr/bin/directory so that the gdbserver command can be executed in any directory)