如何让gdb在OSX 10.11下使用macports工作El Capitan? [英] How to get gdb to work using macports under OSX 10.11 El Capitan?

查看:121
本文介绍了如何让gdb在OSX 10.11下使用macports工作El Capitan?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这源于如何安装gdb(调试器)在Mac OSX El Capitan?



我有在el capitan下工作的macports没有问题,并且已经安装了gdb端口,但是我无法使编码签名工作。这一切似乎都奏效了。证书在那里,并且设置了始终信任。二进制显示:

  $ codesign -d -v -v / opt / local / bin / ggdb 
Executable = / opt / local / bin / ggdb
Identifier = org.gnu.gdb
Format = Mach-O thin(x86_64)
CodeDirectory v = 20100 size = 25320 flags = 0x0(none)哈希= 1261 + 2 location = embedded
签名大小= 1392
Authority = gdb-cert
签名时间= 2015年10月23日,07:56:53
Info.plist条目= 4
TeamIdentifier =未设置
密封资源=无
内部需求计数= 1大小= 88

但是我得到
$ b $ pre $ g

启动程序/ Users / sal / Katiss / ecodriving
无法为进程ID 39278找到Mach任务端口:(os / kern)失败(0x5)。
(请检查gdb是signedigned - 请参阅taskgated(8))

当我尝试开始调试的东西。



任何想法?


$ b
sudo dseditgroup -o编辑-a yourusername -t用户procmod



它将您添加到 procmod



这仅仅是因为只有 procmod 中的用户可以使用函数 task_for_pid ,并且您可以发现自己的组 / opt / local / bin / ggdb procmod


This arose from How to install gdb (debugger) in Mac OSX El Capitan?.

I have macports working under el capitan no problem and have installed the gdb port but I can't get the codesigning to work. It all seems to have worked. The certificate is there and "Always Trust" is set. The binary shows:

$ codesign -d -v -v /opt/local/bin/ggdb 
Executable=/opt/local/bin/ggdb
Identifier=org.gnu.gdb
Format=Mach-O thin (x86_64)
CodeDirectory v=20100 size=25320 flags=0x0(none) hashes=1261+2 location=embedded
Signature size=1392
Authority=gdb-cert
Signed Time=23 Oct 2015, 07:56:53
Info.plist entries=4
TeamIdentifier=not set
Sealed Resources=none
Internal requirements count=1 size=88

but I get

(gdb) r
Starting program: /Users/sal/Katiss/ecodriving 
Unable to find Mach task port for process-id 39278: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))

when I try to start debugging something.

Any ideas?

解决方案

I just settled this problem by using the following command.

sudo dseditgroup -o edit -a yourusername -t user procmod

Which adds you to group procmod.

It's just because only users in procmod can use function task_for_pid, and you can find that the own group of /opt/local/bin/ggdb is procmod.

这篇关于如何让gdb在OSX 10.11下使用macports工作El Capitan?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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