l'L'l
l'L'l

Reputation: 47159

GDB missing in OS X v10.9 (Mavericks)

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!

Upvotes: 108

Views: 99235

Answers (12)

Evalds Urtans
Evalds Urtans

Reputation: 6694

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.

Upvotes: 1

Alexey Lobanov
Alexey Lobanov

Reputation: 102

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.

Upvotes: -4

user1008139
user1008139

Reputation: 301

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

Upvotes: 3

xin
xin

Reputation: 161

This Homebrew command works to install GDB tools on Mavericks:

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

Upvotes: 9

Jakub Głazik
Jakub Głazik

Reputation: 913

You can install it on Mavericks with Homebrew.

brew install homebrew/dupes/gdb

Upvotes: 38

George
George

Reputation: 25

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)

Upvotes: -1

user2928152
user2928152

Reputation:

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.

Upvotes: 0

user2922471
user2922471

Reputation: 31

Run this to install command line tools:

xcode-select --install

Upvotes: -1

antonae
antonae

Reputation: 11

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.

Upvotes: 0

Catfish_Man
Catfish_Man

Reputation: 41801

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

Upvotes: 143

user2928152
user2928152

Reputation:

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

Upvotes: 2

Mehul Thakkar
Mehul Thakkar

Reputation: 12594

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

Upvotes: 1

Related Questions