GDB在山狮上失败 [英] gdb fails on mountain lion

查看:210
本文介绍了GDB在山狮上失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图编译7.x版本的gdb,没有任何运气。
我对可执行文件进行了编码签名(http://sourceware.org/gdb/wiki/BuildingOnDarwin)。



以下版本存在这些问题。



7.5,7.4,git clone:未知的加载命令0x2a(和其他)为我的应用程序和不同的系统库启动gbd时。例如,当我试图打印一个向量时,我总是得到:
找不到main(int,char **)的帧基底

<7.3> macports和gdb-website):在启动应用程序时,它无法设置断点并继续运行。

 (gdb)启动
0x100000950临时断点1:文件../src/main.cpp,第15行。
启动程序:[...]
BFD:无法读取未知加载命令0x24
BFD:无法读取未知的加载命令0x2a
BFD:无法读取未知的加载命令0x26
重新设置断点的错误1:无法访问地址0x100000950处的存储器
[应用程序继续]

我使用系统llvm-gcc,gcc4.7和svn-gcc4.8来编译。
有没有人成功在Mountain Lion上安装gdb?

解决方案

我在山狮上安装了gdb 7.5,没有问题。 。


  1. 这些步骤可以帮助您:./configure --prefix = / usr / local
    --enable -targets = x86_64-apple-darwin10 -enable-64-bit-bfd -disable-werror -build = x86_64-apple-darwin10 -host = x86_64-apple-darwin10 -target = x86_64-apple-darwin10


  2. 然后安装gdb。

  3. gdb
    http://sourceware.org/gdb/wiki/BuildingOnDarwin


  4. 在签署gdb之前,您必须明确声明:codesign -s gdb-cert / usr / local / gdb
    确保您已将证书设置为
    到可信。在签署gdb之前也关闭钥匙串。


希望这也适用于您的


I tried to compile a 7.x Version of gdb without any luck. I codesigned the executable(http://sourceware.org/gdb/wiki/BuildingOnDarwin).

With following version there were these problems.

7.5,7.4,git clone: unknown load command 0x2a (and others) for my application and different system libraries when starting gbd. When trying to print a vector for example i always get: Could not find the frame base for "main(int, char**)"

7.3 (macports and from gdb-website): on starting the application it fails to set the breakpoint and continues to run.

(gdb) start
Temporary breakpoint 1 at 0x100000950: file ../src/main.cpp, line 15.
Starting program: [...]
BFD: unable to read unknown load command 0x24
BFD: unable to read unknown load command 0x2a
BFD: unable to read unknown load command 0x26
Error in re-setting breakpoint 1: Cannot access memory at address 0x100000950
[application continues]

I used the system llvm-gcc, gcc4.7 and svn-gcc4.8 to compile. Has anybody succeeded in installing gdb on Mountain Lion?

解决方案

i installed gdb 7.5 on mountain lion without problems...

  1. those steps might help you: ./configure --prefix=/usr/local --enable-targets=x86_64-apple-darwin10 --enable-64-bit-bfd --disable-werror --build=x86_64-apple-darwin10 --host=x86_64-apple-darwin10 --target=x86_64-apple-darwin10

  2. then make install gdb.

  3. create your own certificate like discribed here and sign the gdb http://sourceware.org/gdb/wiki/BuildingOnDarwin

  4. you have to explicitly state: codesign -s gdb-cert /usr/local/gdb before you sign the gdb make sure you already set your certificate to trusted. also close the keychain before signing your gdb.

hope this also works for your

这篇关于GDB在山狮上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆