我的应用程序运行良好,但gdb无法对其进行调试,出现以下错误
(gdb) run
Starting program: /path/to/app
Unable to find Mach task port for process-id 83767: (os/kern) failure (0x5).
我使用的是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".
发布于 2013-03-20 07:12:04
在Snow Leopard和以后的Mac版本中,协同设计gdb
可执行文件是不够的。
你必须遵循这个指南才能让它工作:http://www.opensource.apple.com/source/lldb/lldb-69/docs/code-signing.txt
该指南解释了如何在lldb
上执行此操作,但对于gdb
,该过程完全相同。
发布于 2014-01-13 05:50:36
当我切换到sudo gdb executableFileName
!:)
发布于 2012-12-31 05:18:59
问题是您没有以root用户身份登录(这是您不想要的)。您需要为gdb创建一个允许访问的证书。按照这个教程,你应该可以开始了……
http://sourceware.org/gdb/wiki/BuildingOnDarwin
如果所有其他方法都失败了,只需使用:sudo gdb executableFileName
https://stackoverflow.com/questions/11504377
复制相似问题