我试图编译的gdb的是7.x版本没有任何的运气。 我codesigned可执行文件(http://sourceware.org/gdb/wiki/BuildingOnDarwin)。
随着下面的版本出现了这些问题。
7.5,7.4,混帐克隆:未知加载命令0x2a(及其他)我的应用程序和启动GBD当不同的系统库。 当试图打印例如向量我总是得到:找不到框架基地“主(INT,CHAR **)”
7.3(MacPorts的和GDB-网站):在启动应用程序失败设置断点,并继续运行。
(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编译。 有没有人成功地在山狮安装GDB?
我通过以下步骤尝试解决这里这个问题: http://coding.derkeiler.com/Archive/Ada/comp.lang.ada/2012-09/msg00305.html
脚步
- 须藤chgrp命令procmod在/ usr / local / bin目录/ GDB
- 须藤CHMOD克+ S的/ usr / local / bin中/ GDB
- 编辑/System/Library/LaunchDaemons/com.apple.taskgated.plist并添加+ p选项taskgated过程
- 强制关闭taskgated过程(将重启)
- 再试一次
相关链接:
- https://blogs.oracle.com/dns/entry/understanding_the_authorization_framework_on
它似乎并没有为我工作...同样的问题与默认设置自制程序
v1:src zeph$ brew install gdb
==> Downloading http://ftpmirror.gnu.org/gdb/gdb-7.5.tar.bz2
Already downloaded: /Library/Caches/Homebrew/gdb-7.5.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/gdb/7.5 --with-python=/usr --with-system-readline --enable-targets=x86_64-apple-darwin10 --enable-64-bit-bfd --disable-werror --build=x86_64-apple-darwin10 --hos
==> make
==> make install
==> Caveats
gdb requires special privileges to access Mach ports.
You will need to codesign the binary. For instructions, see:
http://sourceware.org/gdb/wiki/BuildingOnDarwin
==> Summary
/usr/local/Cellar/gdb/7.5: 62 files, 9.3M, built in 119 seconds
v1:src zeph$ codesign -s gdb-cert /usr/local/Cellar/gdb/7.5/bin/gdb
v1:src zeph$ /usr/local/Cellar/gdb/7.5/bin/gdb --args /Users/zeph/tmp/CouchBase/src/install/bin/memcached -d -u root -P /tmp/0libmemcached_memc.pid -t 1 -p 11221 -U 11221 -m 128
GNU gdb (GDB) 7.5
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin10".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
BFD: /Users/zeph/tmp/CouchBase/src/install/bin/memcached: unknown load command 0x29
BFD: /Users/zeph/tmp/CouchBase/src/install/bin/memcached: unknown load command 0x29
Reading symbols from /Users/zeph/tmp/CouchBase/src/install/bin/memcached...done.
(gdb) run
Starting program: /Users/zeph/tmp/CouchBase/src/install/bin/memcached -d -u root -P /tmp/0libmemcached_memc.pid -t 1 -p 11221 -U 11221 -m 128
Unable to find Mach task port for process-id 28755: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
(gdb)
K,我已经过所有百姓放心全线证书后重新签名
协同设计-fs GDB证书/usr/local/Cellar/gdb/7.5/bin/gdb
有在OP提问两个问题。 关于签署可执行文件或修改taskgated和使用setgid的procmod的一个已经被覆盖。 第二个问题是关于未知装载命令的警告。 我也遇到了这个和一堆遇到下列修补软件,系统修复它搜索出来后:
https://gist.github.com/davidbalbert/4197567