首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >gdb失败,并显示"Unable to find Mach task port for process-id“错误

gdb失败,并显示"Unable to find Mach task port for process-id“错误
EN

Stack Overflow用户
提问于 2012-07-16 20:31:05
回答 8查看 125.8K关注 0票数 153

我的应用程序运行良好,但gdb无法对其进行调试,出现以下错误

代码语言:javascript
运行
复制
(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版本为

代码语言:javascript
运行
复制
$ 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".
EN

回答 8

Stack Overflow用户

回答已采纳

发布于 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,该过程完全相同。

票数 75
EN

Stack Overflow用户

发布于 2014-01-13 05:50:36

当我切换到sudo gdb executableFileName!:)

票数 151
EN

Stack Overflow用户

发布于 2012-12-31 05:18:59

问题是您没有以root用户身份登录(这是您不想要的)。您需要为gdb创建一个允许访问的证书。按照这个教程,你应该可以开始了……

http://sourceware.org/gdb/wiki/BuildingOnDarwin

如果所有其他方法都失败了,只需使用:sudo gdb executableFileName

票数 17
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11504377

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档