在eclipse中使用gdb在mac上进行调试 - 无法执行MI命令:-exec-run [英] debugging in eclipse using gdb on mac - Failed to execute MI command: -exec-run

查看:527
本文介绍了在eclipse中使用gdb在mac上进行调试 - 无法执行MI命令:-exec-run的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的Eclipse开普勒和我的简单的HelloWorld C程序,在那里我想学习如何调试C程序。当点击调试按钮时,我会收到以下错误消息:



最终启动顺序错误
无法执行MI命令:
- exec-run
调试器后端的错误消息:
无法找到进程ID 359的Mach任务端口(os / kern)失败(0x5)。
无法找到进程号359的Mach任务端口(os / kern)失败(0x5)。



我搜索了整整一天,没有找到任何解决方案我已经在这篇文章中完成了所有推荐的事情。 Eclipse GDB MacOSX Mavericks ,仍然会收到此错误。



如果有人可以帮助我在Eclipse中设置调试器,这将是非常好的。



哦我通过macports下载并安装了gdb-apple,我不得不使用codesign命令中的-f选项,因为它不起作用。也许这些是重要的信息。

解决方案

继续使用gdb(而不是gdb-apple),只需执行以下步骤:



1-创建证书:




  • 启动钥匙串访问应用程序(/应用程序/实用程序/钥匙串Access.app)

  • 打开菜单/钥匙串访问/证书助理/创建证书...

  • 选择一个名称(gdb-cert in将身份类型设置为自签名根,将证书类型设置为代码签名,然后选择让我覆盖默认值。

  • 点击几下继续,直到你进入为证书指定位置屏幕,然后将钥匙串设置为系统。

  • 使用证书的上下文菜单,选择获取信息,打开信任项,并设置代码签署始终信任。



2-您必须退出Keychain Access应用程序(名为taskgated,来自活动监视器)并打开再次按顺序使用证书。



3-将证书分配给gdb:




  • 使用以下命令: $ codesign -s gdb-cert gdb



更多细节,请查看此链接:
http://sourceware.org/gdb/wiki/BuildingOnDarwin



如果任何这些步骤不清楚,请随时问。


I have my Eclipse Kepler and my simple HelloWorld C-program, where I wanted to learn how to debug a C-program. 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). Unable to find Mach task port for process-id 359: (os/kern) failure (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.

It would be really great, if somebody could help me out setting up the debugger in 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. Maybe these are important information.

解决方案

Keep using gdb (not gdb-apple) and just do the following steps:

1- Create a certificate:

  • Start Keychain Access application (/Applications/Utilities/Keychain Access.app)
  • Open menu /Keychain Access/Certificate Assistant/Create a Certificate...
  • Choose a name (gdb-cert in the example), set Identity Type to "Self Signed Root", set Certificate Type to "Code Signing" and select the "Let me override defaults".
  • Click several times on Continue until you get to the Specify a Location For The Certificate screen, then set Keychain to System.
  • Using the contextual menu for the certificate, select "Get Info", open the Trust item, and set Code Signing to "Always Trust".

2- You must quit Keychain Access application (named "taskgated",from activity monitor) and open it again in order to use the certificate.

3- Assign the certificate to gdb:

  • using the following command: $ codesign -s gdb-cert gdb

For more details, check this link: http://sourceware.org/gdb/wiki/BuildingOnDarwin

if any of these steps are not clear, feel free to ask.

这篇关于在eclipse中使用gdb在mac上进行调试 - 无法执行MI命令:-exec-run的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆