Install GDB from Source on Mac OS X

It is OK to follow this tutorial to build GDB from source code:

  https://github.com/sirnewton01/godbg
 
But we need to apply a patch before ./configure and make as described in above link:
 
  cd gdb-7.7
  patch < ~/Download/patch // here we need to specify the file to be patched. It is bfd/mach-o.c
  ./configure –prefix=/Users/yiwang/usr –disable-dynamic –enable-static –enable-expact –enable-python
  make -j8
  make install