macOS gdb: please check gdb is codesigned
来源:互联网 发布:查看java进程 编辑:程序博客网 时间:2024/06/01 08:12
# 问题描述:Mac OS Sierra 无法使用gdb调试
- Unable to find Mach task port for process-id 47072: (os/kern) failure (0x5).
- (please check gdb is codesigned - see taskgated(8))
- During startup program terminated with signal SIG113, Real-time event 113.
# 如果是用Homebrew安装的gdb,brew install gdb,安装完有提示
gdb requires special privileges to access Mach ports.
You will need to codesign the binary. For instructions, see:
https://sourceware.org/gdb/wiki/BuildingOnDarwinOn 10.12 (Sierra) or later with SIP, you need to run this:
echo “set startup-with-shell off” >> ~/.gdbinit在macOS上,gdb使用Mach ports需要特殊权限
你需要对二进制文件进行签名。指导步骤,查看:
https://sourceware.org/gdb/wiki/BuildingOnDarwin在10.12 (Sierra) 或之后带SIP的操作系统版本,你还需要运行这个命令:
echo “set startup-with-shell off” >> ~/.gdbinit
# 解决方法
# 具体操作,按照https://sourceware.org/gdb/wiki/BuildingOnDarwin步骤2开始
# 2. Giving gdb permission to control other processes
- 启动 /Applications/Utilities/Keychain Access.app
- 顶部菜单选择 /Keychain Access/Certificate Assistant/Create a Certificate…
- Create Your Certificate
- Name: gdb-cert
- Identity Type: Self Signed Root
- Certificate Type: Code Signing
- 勾选 Let me override defaults
- 一直按continue,直到Specify a Location For The Certificate
- Keychain: System
- tips: 如果无法将Certificate保存到System keychain,就先保存到login keychain,然后导出,再导入到System keychain。
- Create
- 如附图,右键选择gdb-cert的Get Info,打开Trust项,将Code Signing改成Always Trust
- 最后退出Keychain Access以刷新存储证书
- codesign gdb,执行
codesign -s gdb-cert $(which gdb)
- macOS 10.12 (Sierra) 或以上版本的操作系统
- 需要使用 gdb 7.12.1 之上的版本
- 此外,为防止gdb利用shell来启动程序开始debug,执行下面的语句
echo "set startup-with-shell off" >> ~/.gdbinit
- 重启系统
阅读全文
0 0
- macOS gdb: please check gdb is codesigned
- Unable to find Mach task port for process-id 47072: (os/kern) failure (0x5). (please check gdb is c
- macOS Sierra 上使用GDB
- GDB
- gdb
- GDB
- GDB
- gdb
- GDB
- Gdb
- GDB
- gdb
- gdb
- GDB
- GDB
- gdb
- gdb
- gdb
- 常见兼容性问题
- linux堆内存漏洞利用之fastbin
- 给出一个百分制成绩,要求输出成绩等级A,B,C,D,E。90分以上为A,80~89分为B,70~79分为C,60~69分为D,60分以下为E
- HDOJ1022
- 1012. 数字分类 (20)
- macOS gdb: please check gdb is codesigned
- 在header中添加自定义属性防止CSRF
- Verilog中inout的用法(二)
- 笔试面试常考的一些小知识
- 程序员从打字开始
- 蘑菇街-应用平台开发工程师笔试编程题
- 课堂练习1(第四周)
- java自学笔记——枚举类
- ELF与链接