[英]debugging in eclipse using gdb on mac - Failed to execute MI command: -exec-run
I have my Eclipse Kepler and my simple HelloWorld C-program, where I wanted to learn how to debug a C-program. 我有我的Eclipse Kepler和我简单的HelloWorld C程序,我想在这里学习如何调试C程序。 When clicking on the debug-button, I get the following error message: 当单击调试按钮时,出现以下错误信息:
Error in final launch sequence Failed to execute MI command: -exec-run Error message from debugger back end: Unable to find Mach task port for process-id 359: (os/kern) failure (0x5). 最终启动序列中的错误无法执行MI命令:-exec-run来自调试器后端的错误消息:找不到进程ID 359的Mach任务端口:(os / kern)故障(0x5)。 Unable to find Mach task port for process-id 359: (os/kern) failure (0x5). 找不到进程ID 359的Mach任务端口:(os / kern)故障(0x5)。
I searched the whole day and didn't find any solution. 我整天都在搜索,没有找到任何解决方案。 I already did all of the recommended things in this post Eclipse GDB MacOSX Mavericks and still get this error. 我已经在Eclipse GDB MacOSX Mavericks中完成了所有推荐的操作,但仍然出现此错误。
It would be really great, if somebody could help me out setting up the debugger in Eclipse. 如果有人可以帮助我在Eclipse中设置调试器,那就太好了。
Oh and I downloaded and installed gdb-apple via macports and I had to use the "-f" option with the codesign command as it didn't work without. 哦,我通过macports下载并安装了gdb-apple,我不得不在codesign命令中使用“ -f”选项,因为如果没有它,它就无法工作。 Maybe these are important information. 也许这些是重要的信息。
This may happen if you signed 'gdb' before making all changes to 'gdb-cert'. 如果在对“ gdb-cert”进行所有更改之前对“ gdb”进行了签名,则可能会发生这种情况。 Then you can restart 'taskgated' and then re-sign the 'gdb' executable. 然后,您可以重新启动“ taskgated”,然后重新签署“ gdb”可执行文件。
This worked for me. 这对我有用。
Keep using gdb (not gdb-apple) and just do the following steps: 继续使用gdb(而非gdb-apple),只需执行以下步骤:
1- Create a certificate: 1-创建证书:
2- You must quit Keychain Access application (named "taskgated",from activity monitor) and open it again in order to use the certificate. 2-您必须退出“钥匙串访问”应用程序(从活动监视器中命名为“ taskgated”),然后再次打开它才能使用证书。
3- Assign the certificate to gdb: 3-将证书分配给gdb:
$ codesign -s gdb-cert gdb
使用以下命令: $ codesign -s gdb-cert gdb
For more details, check this link: http://sourceware.org/gdb/wiki/BuildingOnDarwin 有关更多详细信息,请检查此链接: http : //sourceware.org/gdb/wiki/BuildingOnDarwin
if any of these steps are not clear, feel free to ask. 如果这些步骤中的任何一个不清楚,请随时提出。
If you get this below error, don't forget to add sudo
in front of the command: 如果出现以下错误,请不要忘记在sudo
前添加sudo
:
sudo codesign -s gdb-cert $(which gdb-apple)
codesign -s gdb-cert $(which gdb-apple)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: can't create output file: /opt/local/bin/gdb-apple.cstemp (Permission denied)
/opt/local/bin/gdb-apple: the codesign_allocate helper tool cannot be found or used
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.