Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup/using GDB 7 on MacOS Lion with MacPorts

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.

like image 662
calquin Avatar asked Aug 19 '11 02:08

calquin


1 Answers

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:

  • http://cgdb.sourceforge.net/
  • https://trac.macports.org/ticket/26450
like image 86
Jason Dagit Avatar answered Oct 31 '22 05:10

Jason Dagit