Compilation and installation of arm-Linux-GDB + gdbserver in Ubuntu

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.