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

余生长醉 提交于 2019-12-04 16:26:36

问题


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.


回答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:

  • http://cgdb.sourceforge.net/
  • https://trac.macports.org/ticket/26450



回答2:


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/



来源:https://stackoverflow.com/questions/7116347/how-to-setup-using-gdb-7-on-macos-lion-with-macports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!