Codesigning the Debugger OSX gdb签名

 搞了个MBP  让gdb 好折腾 原文 地址 


gdb a.out

然后直接r 出现

   Starting program: /x/y/foo
     Unable to find Mach task port for process-id xxx: (os/kern) failure (0x5).
      (please check gdb is codesigned - see taskgated(8)
然后就挂了 gdb 未签名,这么个意思,没用过 

原文 ,不贴图了

Start the Keychain Access application (in /Applications/Utilities/Keychain Access.app)
Select the Keychain Access -> Certificate Assistant -> Create a Certificate... menu
Then:
Choose a name for the new certificate (this procedure will use "gdb-cert" as an example)
Set "Identity Type" to "Self Signed Root"
Set "Certificate Type" to "Code Signing"
Activate the "Let me override defaults" option
Click several times on "Continue" until the "Specify a Location For The Certificate" screen appears, then set "Keychain" to "System"
Click on "Continue" until the certificate is created
Finally, in the view, double-click on the new certificate, and set "When using this certificate" to "Always Trust"
Exit the Keychain Access application and restart the computer (this is unfortunately required)
 意思是

打开钥匙串 launchpad里面打开 


选择证书   创建证书,ok 创建证书 ,名字随便  这个就叫gdb-cert, 类型选择代码签名 overrive选中  各种东西可以不填 选继续 ,等继续几次之后看到证书类型 登录,修改为系统然后完成。

然后在钥匙串找到证书双击 选择总是信任 ,输入密码,退出钥匙串 重启系统!!!


接下来

 codesign -f -s  "gdb-cert"  /bin/gdb
签名 codesign -f -s "gdb-cert" $(which gdb)  可能需要sudo 运行

签名之后就可以用了

第一次运行会询问是否信任 输入用户名 密码 信任就ok了


你可能感兴趣的:(Codesigning the Debugger OSX gdb签名)