简体   繁体   English

gdb在创建证书和codesign后无法在mac os下工作

[英]gdb cannot work under mac os after creating a certificate and codesign

I have been trying to install and use gdb in mac os.我一直在尝试在 mac os 中安装和使用 gdb。 I first homebrew gdb and create a certificate from the keychain i followed the steps online.我首先自制 gdb 并从钥匙串创建证书,我按照在线步骤操作。 I also kill the taskgated and try to codesign in the terminal.我还杀死了 taskgated 并尝试在终端中进行代码设计。 Everything seems to work, but when I tried to use gdb, I still get一切似乎都有效,但是当我尝试使用 gdb 时,我仍然得到

Unable to find Mach task port for process-id 730: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))

I also tried to run我也试着跑

sudo gdb <name>

I get the information like this我得到这样的信息

Starting program: /Users/leon/Desktop/os4/kitty -o o.txt in.txt
[New Thread 0x1303 of process 744]
[New Thread 0x1103 of process 744]
During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.

Thank you for any help!感谢您的任何帮助!

codesign all by itself doesn't do anything. codesign本身并没有做任何事情。 You must specify what to sign and which cert to use.您必须指定要签名的内容以及要使用的证书。

The syntax is like: codesign -fs nameofcertificate /path/to/binaryexecutable语法类似于: codesign -fs nameofcertificate /path/to/binaryexecutable

For example if you named the certificate gdbc and you are trying to sign /usr/local/bin/gdb then you would issue the following command:例如,如果您将证书命名为gdbc并尝试签署/usr/local/bin/gdb ,那么您将发出以下命令:

codesign -fs gdbc /usr/local/bin/gdb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM