【macOS】macOS安装gdb 2018.12

lldb的插件不太会用,因此尝试在macOS上安装一下gdb,还是遇到很多问题,暂且记录一下。很快brew应该就更新了,到时直接brew  install gdb即可。

20181212最终安装方案:

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/cb7a4c1b8e52220ed8d5d382268e5a36fad99815/Formula/gdb.rb --HEAD

方法二(未尝试),切换到gdb8.0.1 https://github.com/Homebrew/homebrew-core/issues/25172

给gdb签名

- https://www.jianshu.com/p/ce2d77d7d1c4
- https://blog.csdn.net/am290333566/article/details/81186399

注:我使用 codesign -v /usr/local/bin/gdb 代码签名后,还是会遇到错误,暂时未解决,所以我是sudo gdb启动程序的。如果有解决的同学麻烦评论告诉我~

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

最终的gdb版本

➜  ~ gdb
GNU gdb (GDB) 8.2.50.20181212-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin18.2.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".

 

参考:

https://stackoverflow.com/questions/52529838/gdb-8-2-cant-recognized-executable-file-on-macos-mojave-10-14

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值