2015-09-19 156 views
1

计算机设置:Mac OS X优胜美地Mac OS X无法运行GDB

我的gdb功能很好。但今天,

当我尝试使用gdb来调试:

(gdb) run 
Starting program: /Users/JackZhao/Desktop/work/reviewC/pp 
Unable to find Mach task port for process-id 627: (os/kern) failure (0x5). 
(please check gdb is codesigned - see taskgated(8)) 

我尝试添加钥匙扣这样的; http://ntraft.com/installing-gdb-on-os-x-mavericks/ 这: https://sourceware.org/gdb/wiki/BuildingOnDarwin

,然后重新启动计算机。但问题仍然存在。

回答

0

这可以固定通过设置taskgated plist中-p:

编辑(如须藤):/System/Library/LaunchDaemons/com.apple.taskgated.plist

 ... <snip> ... 

     <key>ProgramArguments</key> 
     <array> 
       <string>/usr/libexec/taskgated</string> 
       <string>-sp</string> 
     </array> 

taskgated手册:

OPTIONS 
-p  Accepts the old (Tiger) convention that a process with a primary effective group of procmod or procview is allowed to get task ports. Without this option, this legacy mode 
      is not supported. 

参考: https://trac.macports.org/ticket/36727

+1

这不是一个很好的解决方案 - 它会停止w在Mac OS X 10.11的发行版中进行操作,因为不再可能在'/ System'中编辑文件。 – duskwuff

+0

@duskwuff让你投下一个实际有用的解决方案_today_,因为它在下一个OS X版本中无法使用?我从字面上只发现了这个问题,因为我试图解决同样的问题,我需要比原生安装的更新版本的gdb(ggdb)。 – Gareth

+1

El Capitan *非常接近发布 - 有一个公开候选人可用,RTM可能会在未来几周内发布。这不是“它最终会停止工作”的问题;它会很快停止工作。 – duskwuff