mac上安装gdb及使用中碰到的问题
2017-04-05 10:27
363 查看
安装homebriew,执行命令
根据官方介绍,其功能是:“使用
Homebrew 安装 Apple 没有预装但 你需要的东西。”。
完全基于 git 和 ruby,所以自由修改的同时你仍可以轻松撤销你的变更或与上游更新合并。
Homebrew 的配方都是简单的 Ruby 脚本:
然后执行 brew install gdb 进行安装
安装好了以后执行,出错,提示:
“Unable to find Mach task port for process-id 7532: (os/kern) failure (0x5).”
原因出于苹果系统的安全性,想想现在gdb是要对另一个进程进行全面的掌控,这件事不能随便轻易允许。
因此需要创建证书,然后 :
codesign -s gdb_cert /usr/local/bin/gdb 对gdb进行codesign签名方可允许。
现在执行gdb可以打开,但是依然运行出错,提示:
“During startup program terminated with signal ?, Unknown signal.”
这与sierra 的 System Runtime Integrity Protection 系统有关。
据网友对Apple官网上的SIP介绍的总结,有以下几个关键点:
+ Security Integrity Protection applied to every process, including privileged code running unsandboxed.
+ Extends additional protections on system components on disk and at runtime
+ System binaries only can be modified by Apple Installer and Software Updater, and no longer permit runtime attachment or code injection.
SIP系统保护机制可以用 crsutil status/disable/enable/clear 进行查看和修改。
解决方法暂时有2个:
+ 关闭SIP。步骤:
进入恢复模式(开机时按住Command+R,亲测有效),然后打开terminal 执行 csrutil disable,关闭SIP。
+ 关闭 startup-with-shell。步骤:
在.gdbinit中加入 set startup-with-shell off。
经过对比,在不关闭startup-with-shell的情况下,关闭SIP确实可以解决5中的问题
4000
.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
根据官方介绍,其功能是:“使用
Homebrew 安装 Apple 没有预装但 你需要的东西。”。
完全基于 git 和 ruby,所以自由修改的同时你仍可以轻松撤销你的变更或与上游更新合并。
$ brew edit wget # 使用 $EDITOR 编辑!
Homebrew 的配方都是简单的 Ruby 脚本:
class Wget < Formula homepage "https://www.gnu.org/software/wget/" url "https://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz" sha256 "52126be8cf1bddd7536886e74c053ad7d0ed2aa89b4b630f76785bac21695fcd" def install system "./configure", "--prefix=#{prefix}" system "make", "install" end end
然后执行 brew install gdb 进行安装
安装好了以后执行,出错,提示:
“Unable to find Mach task port for process-id 7532: (os/kern) failure (0x5).”
原因出于苹果系统的安全性,想想现在gdb是要对另一个进程进行全面的掌控,这件事不能随便轻易允许。
因此需要创建证书,然后 :
codesign -s gdb_cert /usr/local/bin/gdb 对gdb进行codesign签名方可允许。
现在执行gdb可以打开,但是依然运行出错,提示:
“During startup program terminated with signal ?, Unknown signal.”
这与sierra 的 System Runtime Integrity Protection 系统有关。
据网友对Apple官网上的SIP介绍的总结,有以下几个关键点:
+ Security Integrity Protection applied to every process, including privileged code running unsandboxed.
+ Extends additional protections on system components on disk and at runtime
+ System binaries only can be modified by Apple Installer and Software Updater, and no longer permit runtime attachment or code injection.
SIP系统保护机制可以用 crsutil status/disable/enable/clear 进行查看和修改。
解决方法暂时有2个:
+ 关闭SIP。步骤:
进入恢复模式(开机时按住Command+R,亲测有效),然后打开terminal 执行 csrutil disable,关闭SIP。
+ 关闭 startup-with-shell。步骤:
在.gdbinit中加入 set startup-with-shell off。
经过对比,在不关闭startup-with-shell的情况下,关闭SIP确实可以解决5中的问题
4000
.
相关文章推荐
- mac使用phpize进行安装的时候碰到的问题
- mac下安装使用gdb调试
- Python 2.7版本安装pip,及使用pip碰到的问题
- Mac下安装brew & 使用brew安装gdb
- mac下如何修改文件权限(针对Cocoapod安装成功使用时一直提示command not found问题)
- 关于mac osx上安装 freetds unixodbc 及安装碰到的问题
- Spring Boot项目在Mac下使用Maven启动时碰到的神奇问题:Unregistering JMX-exposed beans on shutdown
- Mac 下使用homebrew 安装node后全局安装找不到问题
- 关于本人在VMware安装MAC碰到的问题和解决办法
- Mac使用brew安装nginx,并解决端口访问权限问题
- 关于新版MySQL5.7数据库安装后使用自生成初始密码登录的问题(MAC版)
- mac 使用homebrew安装MySQL 无法登陆问题
- Mac 更新到10.11.3cocoapods的安装及使用问题
- 在mac中使用brew安装nginx步骤及相关问题
- mac(10.7.5)安装qt5.2碰到的问题总结
- 解决mac使用homebrew安装MySQL无法登陆问题
- linux卸载,安装win7碰到的问题总结,使用MbrFix.exe修复mbr
- Mac(os x)下使用gdb的问题
- MAC 抓包神器charles的安装、使用及问题解答
- RVM的安装和使用过程中碰到的问题