“请检查gdb是否被编码 - 请参阅taskgated(8)” - 如何获得gdb安装与自制密码签名? [英] "please check gdb is codesigned - see taskgated(8)" - How to get gdb installed with homebrew code signed?

查看:272
本文介绍了“请检查gdb是否被编码 - 请参阅taskgated(8)” - 如何获得gdb安装与自制密码签名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在osx 10.8.4下安装了gdb 7.5.1与自制软件(动机得到一个新的gdb与新功能,如--with-python等...)



当我在一个c ++ Eclipse项目中运行调试时,长的故事很短,我得到:

 最终启动顺序错误
无法执行MI命令:
-exec-run
调试器后端的错误消息:
无法找到进程标识的Mach任务端口46234:(os / kern)失败(0x5)。
(请检查gdb是否已编码 - 请参阅taskgated(8))
无法找到进程号46234的Mach任务端口((os / kern))(0x5)。
(请检查gdb是否已编码 - 请参阅taskgated(8))

代码签名建议





所以我做了:


  1. 设置证书

  2. 签名gdb - > codesign -s gdb-cert / usr / local / bin / gdb

当我在Eclipse中重新运行调试时,我遇到与上述相同的错误(请检查gdb如果我将gdb设置为旧的gdb(在Eclipse的gdb首选项中)/ usr / libexec / gdb / gdb-i386-apple-darwin调试按预期运行。



任何解决方案/提示?



Thx



Pelle

解决方案

由于OSX实现了一个需要二进制数字签名的pid访问策略访问其他进程的pid。要启用gdb访问其他进程,我们必须首先对二进制进行编码。该签名取决于用户必须创建并向系统注册的特定证书。



要创建代码签名证书,请打开钥匙串访问应用程序。选择菜单钥匙串访问 - >证书助理 - >创建证书...



选择证书的名称(例如,gdb-cert),将身份类型设置为自签名根,将证书类型设置为代码签名,然后选择让我覆盖默认值。点击几次继续,直到进入为证书指定位置屏幕,然后将钥匙串设置为系统。



双击证书,打开信任部分,将代码签名设置为始终信任。退出钥匙串访问应用程序。



重新启动任务服务,并签署二进制文件。

  $ sudo killall taskgated 
$ codesign -fs gdb-cert$(which gdb)

source http://andresabino.com/2015/04/14/codesign-gdb-on-mac-os-x-yosemite-10-10-2/


I'm under osx 10.8.4 and have installed gdb 7.5.1 with homebrew (motivation get a new gdb with new features such as --with-python etc... )

Long story short when I run debug within a c++ Eclipse project I get :

Error in final launch sequence
Failed to execute MI command:
-exec-run
Error message from debugger back end:
Unable to find Mach task port for process-id 46234: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
Unable to find Mach task port for process-id 46234: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))

I have followed various suggestions for code signing

So I did:

  1. Set up the certificate
  2. Sign the gdb -> codesign -s gdb-cert /usr/local/bin/gdb

When I re-run debugging in Eclipse I get same error as above "(please check gdb is codesigned - see taskgated(8))".

If I set back the gdb to the older gdb (in the gdb preferences of Eclipse) /usr/libexec/gdb/gdb-i386-apple-darwin the debugging runs as expected.

Any solutions / hints out there ?

Thx

Pelle

解决方案

This error occurs because OSX implements a pid access policy which requires a digital signature for binaries to access other processes pids. To enable gdb access to other processes, we must first code sign the binary. This signature depends on a particular certificate, which the user must create and register with the system.

To create a code signing certificate, open the Keychain Access application. Choose menu Keychain Access -> Certificate Assistant -> Create a Certificate…

Choose a name for the certificate (e.g., gdb-cert), set Identity Type to Self Signed Root, set Certificate Type to Code Signing and select the Let me override defaults. Click several times on Continue until you get to the Specify a Location For The Certificate screen, then set Keychain to System.

Double click on the certificate, open Trust section, and set Code Signing to Always Trust. Exit Keychain Access application.

Restart the taskgated service, and sign the binary.

$ sudo killall taskgated
$ codesign -fs gdb-cert "$(which gdb)"

source http://andresabino.com/2015/04/14/codesign-gdb-on-mac-os-x-yosemite-10-10-2/

这篇关于“请检查gdb是否被编码 - 请参阅taskgated(8)” - 如何获得gdb安装与自制密码签名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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