Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
843 views
in Technique[技术] by (71.8m points)

macos - Gdb on Mac OS X v10.7 (Lion)

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)
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...