Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gdb on Mac OS X v10.7 (Lion)

Tags:

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) 
like image 380
bsr Avatar asked Dec 01 '11 04:12

bsr


People also ask

Can you install GDB on Mac?

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.

What is the latest version of Mac OS X Lion?

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.


1 Answers

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:

  • Use http://www.macports.org/
  • Look here https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers

This is probably the command for you:

brew install https://raw.github.com/Homebrew/homebrew-dupes/master/gdb.rb 
like image 123
逆さま Avatar answered Sep 28 '22 18:09

逆さま