gdb 在山狮上失败 [英] gdb fails on mountain lion
问题描述
我试图编译一个 7.x 版本的 gdb,但没有任何运气.我对可执行文件进行了代码签名(http://sourceware.org/gdb/wiki/BuildingOnDarwin).
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:启动 gbd 时我的应用程序和不同系统库的未知加载命令 0x2a(和其他).例如,当尝试打印矢量时,我总是得到:找不到main(int, char**)"的框架基础
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 和 gdb-website):在启动应用程序时,它无法设置断点并继续运行.
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]
我使用系统llvm-gcc、gcc4.7和svn-gcc4.8编译.有人在 Mountain Lion 上成功安装了 gdb 吗?
I used the system llvm-gcc, gcc4.7 and svn-gcc4.8 to compile. Has anybody succeeded in installing gdb on Mountain Lion?
推荐答案
我在山狮上安装gdb 7.5没有问题...
i installed gdb 7.5 on mountain lion without problems...
这些步骤可能会对您有所帮助:./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
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
然后make安装gdb.
then make install gdb.
创建您自己的证书(如此处所述)并签署 gdbhttp://sourceware.org/gdb/wiki/BuildingOnDarwin
create your own certificate like discribed here and sign the gdb http://sourceware.org/gdb/wiki/BuildingOnDarwin
你必须明确声明:codesign -s gdb-cert/usr/local/gdb在你签署 gdb 之前确保你已经设置了你的证书到信任.在签署 gdb 之前也要关闭钥匙串.
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.
希望这也适用于你
这篇关于gdb 在山狮上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!