Building GDB with Python from source

Documentation

  1. Download source releases
  2. Invoke the configure script
  3. Run make
wget https://ftp.gnu.org/gnu/gdb/gdb-9.2.tar.xz
tar -xf gdb-9.2.tar.xz

cd gdb-9.2
mkdir build
cd build
../configure --with-python=/usr/bin/python3

make -j4
sudo make install

Looks like in newer versions (10 onwards), we can run configure without creating a build folder.