GDB missing in OS X v10.9 (Mavericks)

XcodeMacosGdb

Xcode Problem Overview


I went to use GDB in OS X v10.9 (Mavericks), and it's not there. Where has it gone?

# /usr/lib/gdb
-bash: /usr/bin/gdb: No such file or directory
# gdb
-bash: gdb: command not found

I also launched Xcode 5.0.1:

> Preferences > Downloads

..and there's no longer command line tools available — ffs!

Xcode Solutions


Solution 1 - Xcode

gdb has been replaced by lldb, and is no longer supported. gcc and llvm-gcc are also gone, replaced by clang.

Solution 2 - Xcode

You can install it on Mavericks with Homebrew.

brew install homebrew/dupes/gdb

Solution 3 - Xcode

This Homebrew command works to install GDB tools on Mavericks:

brew install https://raw.github.com/Homebrew/homebrew-dupes/master/gdb.rb

Solution 4 - Xcode

Thanks I'L'I. I used your ./configure options and worked like a charm. Next step is to tell OS X that we allow GDB to debug. This is done by creating a certificate through the keychain, export it and then sudo codesing -s gdb-cert /route/to/gdb, give credential and we are done.

See GDB wiki detailed instructions

Solution 5 - Xcode

I compiled GDB from the source in Maverics.

I altered the makefile (after ./configure) to suppress some errors that should have been warnings...(added the -Wno-string-plus-int)

Line 385:
CFLAGS = -g -O2 -Wno-string-plus-int

Line 388:
CXXFLAGS = -g -O2 -Wno-string-plus-int

Don't know if both are necessary.

But

As it turns out the standard version does not support debugging from .app files (as needed for Lazarus apps using the Carbon interface)

If you want to do it yourself follow this link: https://sourceware.org/gdb/wiki/BuildingOnDarwin

Solution 6 - Xcode

Follow the steps given at here, it is working fine:http://wiki.lazarus.freepascal.org/GDB_on_OS_X_Mavericks_and_Xcode_5

Solution 7 - Xcode

In my case I got it working on OS X with the following steps:

  1. Setup GDB Homebrew exactly like described here http://wiki.lazarus.freepascal.org/GDB_on_OS_X_Mavericks_and_Xcode_5

  2. Then set debugging to Dwarf2: Project -> Project Options.. Enter image description here

If Run/Build hangs up then restart computer (taskgated or some other process certificate most likely not authenticated), debugging settings back to "automatic (-g)" compile & run (authentication dialog appears & log in), then change debugging settings to "Dwarf2" and it should compile again

Try to always stop GDB when if it crashes after a run operation to prevent this authentication failure.

Solution 8 - Xcode

You could install www.macports.org and install GDB. However, you'll have to wait for the MacPorts installer for Mavericks, as at the time of writing this it is not yet released.

Solution 9 - Xcode

When I looked MacPorts WAS not yet available for Mavericks, but now it is!

Fink still isn't.

But the standard GDB still does not support debugging .app files.

Solution 10 - Xcode

Run this to install command line tools:

xcode-select --install

Solution 11 - Xcode

Command line utils isn't included in the new Xcode, but you can get it following these directions. (The Xcode select comment above didn't work for me.)

Open up Xcode

In the application menu item "Xcode", select Open Developer ToolMore Developer Tools...

This takes you to a site with a bunch of software. Go ahead and download and install "Command Line Tools (OS X Mavericks) for Xcode - Late October 2013".

(Credit to Jore https://discussions.apple.com/message/23513040#23513040)

Solution 12 - Xcode

Install Mac OS X v10.8 (Mountain Lion) with Xcode 4.6 in a virtual machine and get fun )))

I use VMware Fusion, but you can try the free VirtualBox. You can get old versions of MacOS from AppStore and old version of Xcode from Apple Developer site.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionl'L'lView Question on Stackoverflow
Solution 1 - XcodeCatfish_ManView Answer on Stackoverflow
Solution 2 - XcodeJakub GłazikView Answer on Stackoverflow
Solution 3 - XcodexinView Answer on Stackoverflow
Solution 4 - Xcodeuser1008139View Answer on Stackoverflow
Solution 5 - XcodeBenView Answer on Stackoverflow
Solution 6 - XcodeMehul ThakkarView Answer on Stackoverflow
Solution 7 - XcodeEvalds UrtansView Answer on Stackoverflow
Solution 8 - XcodeantonaeView Answer on Stackoverflow
Solution 9 - XcodeBenView Answer on Stackoverflow
Solution 10 - Xcodeuser2922471View Answer on Stackoverflow
Solution 11 - XcodeGeorgeView Answer on Stackoverflow
Solution 12 - XcodeAlexey LobanovView Answer on Stackoverflow