我的应用程序运行正常,但gdb无法调试它与以下错误
(gdb) run
Starting program: /path/to/app
Unable to find Mach task port for process-id 83767: (os/kern) failure (0x5).
Run Code Online (Sandbox Code Playgroud)
我在OS X Lion上.GDB版本是
$ gdb --version
GNU gdb 6.3.50-20050815 (Apple version gdb-1752) (Sat Jan 28 03:02:46 UTC 2012)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".
Run Code Online (Sandbox Code Playgroud)
小智 128
它改变的时候有效sudo gdb executableFileName
!:)
Tyi*_*ilo 58
在Snow Leopard和后来的Mac OS版本中,仅对gdb
可执行文件进行编码是不够的.
您必须遵循本指南才能使其正常工作:http://www.opensource.apple.com/source/lldb/lldb-69/docs/code-signing.txt
该指南解释了如何做到这一点lldb
,但过程完全相同gdb
.
qed*_*qed 31
您需要创建证书并签署gdb:
最后你可以签署gdb:
sudo codesign -s gdb-cert /usr/local/bin/ggdb
sudo ggdb ./myprog
小智 15
问题是您没有以root用户身份登录(您不想要).您需要为gdb创建一个允许访问的证书.按照本教程,你应该好好去......
http://sourceware.org/gdb/wiki/BuildingOnDarwin
如果所有其他方法都失败了,只需使用:sudo gdb executableFileName
这个链接有一个最清晰,最详细的步骤,让这个错误消失了.
在我的情况下,我必须将密钥作为"系统"密钥,否则它不起作用(并非每个网址都提到).
杀戮taskgated
也是必须重启的可行(且更快)的替代方案.
在开始此过程之前我还卸载了MacPorts并使用了卸载当前的gdb brew uninstall gdb
.
归档时间: |
|
查看次数: |
93726 次 |
最近记录: |