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

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

问题描述

我在osx 10.8.4和已安装gdb 7.5.1与homebrew(动机获得一个新的gdb与新的功能,如--with-python等...)



当我在一个c ++ Eclipse项目中运行调试时,我会遇到很多问题:

  
无法执行MI命令:
-exec-run
来自调试器后端的错误消息:
无法找到进程标识的Mach任务端口46234:(os / kern)失败(0x5)。
(请检查gdb是否已签名 - 请参阅taskgated(8))
无法找到进程id的Mach任务端口46234:(os / kern)失败(0x5)。
(请检查gdb是否已签署 - 请参阅taskgated(8))

建议代码签名





所以我做了:




  • 签署gdb - > codesign -s gdb-cert / usr / local / bin / gdb

  • 当我在Eclipse中重新运行调试时,我得到与上面相同的错误(请检查gdb是否已签名 - 参见taskgated(8)



    如果我将gdb设置为旧的gdb(在Eclipse的gdb首选项中)/ usr / libexec / gdb / gdb-i386-apple-darwin



    任何解决方案/提示在那里?



    Thx



    Pelle

    解决方案

    发生此错误是因为OSX实现了pid访问策略,访问其他进程pids。要启用gdb访问其他进程,我们必须首先对二进制进行编码。此签名取决于用户必须创建并向系统注册的特定证书。



    要创建代码签名证书,请打开Keychain Access应用程序。选择菜单Keychain Access - >证书助手 - >创建证书...



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



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



    重新启动taskgated服务并签名二进制文件。

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

    来源 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天全站免登陆