Mac配置gdb的一些问题

1.Unable to find Mach task port for process-id 1527: (os/kern) failure (0x5).

  (please check gdb is codesigned - see taskgated(8))

参考资料:解决GDB在Mac下不能调试的问题

因为在没有证书的情况下默认是不允许调试程序的。

注意,指定钥匙串储存位置选为“系统”。 

2.During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.

重新启动command+R在终端运行 csrutil disable 关闭SIP.

然而我关了SIP之后,好像只是把vscode强制关闭了一遍,就又出现这个问题了……(我也不清楚是不是强制关闭的锅)

3.During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.

接着上面的鬼事情……

参考资料:mac上配置GDB遇到的坑及解决方法

解决方法是将gdb回滚至8.0.1:先 brew unlink gdb 再 brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9ec9fb27a33698fc7636afce5c1c16787e9ce3f3/Formula/gdb.rb 。

注意如果回滚了,那么还要执行一遍 codesign -s gdb_codesign /usr/local/bin/gdb 对8.0.1的gdb签名

brew的事情就不记了……

猜你喜欢

转载自www.cnblogs.com/antiquality/p/10257533.html