I am a new Mac user and wonder how to install the latest version of GDB (> 7.1). I prefer to use Homebrew, but I could not find GDB listed.
brew install gdb Error: No available formula for gdb
What is the best way to do it?
When installed Xcode, it may have installed an older version. Currently,
$ which gdb /usr/bin/gdb $ gdb --version GNU gdb 6.3.50-20050815 (Apple version gdb-1705) (Fri Jul 1 10:50:06 UTC 2011) Copyright 2004 Free Software Foundation, Inc.
But I need version > 7.1
System version,
Model Name: MacBook Air System Version: Mac OS X 10.7.1 (11B2118)
As with GCC, the easiest way to install GDB is through Homebrew. In a Terminal window, run the command brew install gdb , and wait for it to complete. (As usual, it may ask for your password.) Now, we need to code-sign the GDB executable, so it will be allowed to control other processes, as necessary for a debugger.
OS X Mountain Lion (version 10.8) is the ninth major release of macOS, Apple Inc.'s desktop and server operating system for Macintosh computers.
Homebrew does not provide gcc and the associated development tool formulas over concerns that custom/non-system compilers could break builds. Two possibilities for easiness:
This is probably the command for you:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/gdb.rb
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With