Building GDB from Source
July 16, 2018
This post covers compiling the GDB source code on an x86 or amd64 machine, in order to set up a local development environment. Note that it may take over an hour.
Download Linux Hypervisor
-
Install virtualbox and vagrant.
-
Install a debian box by running:
vagrant init debian/stretch64
vagrant up
Install Dependencies
vagrant ssh
sudo apt-get build-dep gdb
sudo apt-get install -y texinfo flex bison dejagnu
sudo apt-get install -y emacs vim git automake
git clone git://sourceware.org/git/binutils-gdb.git gdb
Compile and Test
cd gdb
./configure --enable-targets=all --with-expat
make
sudo make install
make check -j4 >& output.log
logout
vagrant halt
For a more comprehensive guide, “Working on GDB” from gbenson.net is an excellent resource.