15

I run into trouble using GDB 7 (7.3) on MacOS Lion.

What I did was:

$ sudo port install gdb

After that GDB was installed to: /opt/local/bin/ggdb

But when I try to execute GDB I always receive the following at start:

BFD: unable to read unknown load command 0x24
BFD: unable to read unknown load command 0x26
BFD: unable to read unknown load command 0x24
BFD: unable to read unknown load command 0x26

Further it tells me:

Reading symbols from ... done.

but when I try to get for example a backtrace via 'bt' I only see unresolved function adresses. I tried to set the LIBRARY_PATH inside my application folder.

$ export DYLD_LIBRARY_PATH=`pwd` 

but without success. The problems remain.

Using the default GDB 6.3 which is provided with Lion/Xcode works fine.

Thanks in advance for any advice.

calquin
  • 421
  • 1
  • 4
  • 10
  • You might try cvs head, as there has been work this month getting BFD working with changes to mach-o on lion. See the emails starting with the subject [mach-o. I cannot comment on if lion will ever be supported in a future 7.3.x release, my guess is it will only be supported in 7.4 http://sourceware.org/ml/binutils/2011-08/ – matt Aug 19 '11 at 03:09
  • I tried today 7.3.0.20110822 but I get the same BFD messages. – calquin Aug 23 '11 at 15:13
  • This problem still seems to persist. – StackedCrooked Sep 08 '12 at 14:33

2 Answers2

1

Try cgdb for now, it's actually pretty nice so far:

sudo port install cgdb

I don't claim to understand why the latest gdb sources have an issue on the mac, but I have the same issue as you and I tried cgdb and it works for me. Links for more information:

Jason Dagit
  • 13,684
  • 8
  • 33
  • 56
0

On Maverick follow this instructions that use homebrew. It seems that Apple's new system makes it hard to use gdb... http://ntraft.com/installing-gdb-on-os-x-mavericks/

Vlad
  • 4,425
  • 1
  • 30
  • 39