-->

GDB的山狮失败(gdb fails on mountain lion)

2019-06-27 05:34发布

我试图编译的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?

Answer 1:

我安装在山狮GDB 7.5没有问题...

  1. 这些步骤可以帮助你:的./configure --prefix =在/ usr /本地--enable-目标= x86_64的 - 苹果darwin10 --enable-64位BFD - 禁用werror --build = x86_64的,Apple苹果darwin10主机= x86_64的-苹果darwin10 --target = x86_64的-苹果darwin10

  2. 然后进行安装GDB。

  3. 创建自己的证书喜欢这里discribed并签署GDB http://sourceware.org/gdb/wiki/BuildingOnDarwin

  4. 你必须明确说明:您签署GDB确保你已经设置你的证书信任的协同设计-s GDB证书在/ usr /本地/ GDB之前。 也关闭签署您的gdb之前在钥匙串。

希望这也适用于您的



Answer 2:

我通过以下步骤尝试解决这里这个问题: http://coding.derkeiler.com/Archive/Ada/comp.lang.ada/2012-09/msg00305.html

脚步

  1. 须藤chgrp命令procmod在/ usr / local / bin目录/ GDB
  2. 须藤CHMOD克+ S的/ usr / local / bin中/ GDB
  3. 编辑/System/Library/LaunchDaemons/com.apple.taskgated.plist并添加+ p选项taskgated过程
  4. 强制关闭taskgated过程(将重启)
  5. 再试一次

相关链接:

  1. https://blogs.oracle.com/dns/entry/understanding_the_authorization_framework_on


Answer 3:

它似乎并没有为我工作...同样的问题与默认设置自制程序

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



Answer 4:

有在OP提问两个问题。 关于签署可执行文件或修改taskgated和使用setgid的procmod的一个已经被覆盖。 第二个问题是关于未知装载命令的警告。 我也遇到了这个和一堆遇到下列修补软件,系统修复它搜索出来后:

https://gist.github.com/davidbalbert/4197567



文章来源: gdb fails on mountain lion