Install GDB on OS X Mavericks from source

from:Code Greenhorn



Mavericks logo

With Mavericks Update, Apple has replaced GDB by LLDB, which is a part of the LLVM suit.

It might have been a good move on Apple’s side as it includes tons of new features and is also catching up with gdb on the run-time performance part (you can read more about it here).
But I needed GCC and GDB for one of my projects and so here goes a post about it.


You can get GCC by installing Command-line-tools package in OS X.

If you hit gcc in terminal it will prompt you for installing command line tool package, you can also fetch it directly from Apple dev download section

But that comes with LLDB as the debugger, unlike previous releases of OS X (till Mountain Lion) which included GDB too.






Linux 包含了一个叫gdb 的GNU 调试程序。gdb 是一个用来调试C和C++程序的强力调试器。它使你能在程序运行时观察程序的内部结构和内存的使用情况。以下是 gdb 所提供的一些功能:它使你能监视你程序中变量的值、它使你能设置断点以使程序[……]