适用于Mac的Eclipse C ++ GDB调试器 [英] Eclipse C++ GDB debugger for Mac

查看:111
本文介绍了适用于Mac的Eclipse C ++ GDB调试器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我整天都在尝试使用Eclipse,但是每次都失败了。
我知道我可能是错的,而且我确实知道有很多人正在为开源项目而努力,但是如果我不能使用程序,请运行并调试世界文件,肯定有问题。



我正在使用OSX 10.9.5(是的,也许使用Mac是我的第一个错误,对吧?)。 / p>

每次我尝试调试 Hello World.cpp程序时,都会出现以下错误。



< a href = http://imgur.com/RgXCSyW rel = noreferrer> http://imgur.com/RgXCSyW



是,我在Google上到处搜索。
是的,我已经看到过类似主题的其他回复,并且我已经尝试了他们提供的解决方案。不幸的是,它没有用。



感谢大家的耐心等待,我希望有一天能学习编码,并可能对其他人有所帮助。



Luca



ps编写错误,以便其他正在使用它的人可以找到它




最终启动序列中的错误
无法执行MI命令:
-exec-run
来自调试器后端的错误消息:
找不到进程ID 33383的Mach任务端口:(os / kern)失败(0x5).\n(请检查gdb是代码签名的-请参见taskgated(8))
无法找到进程ID 33383的Mach任务端口:(os / kern)失败(0x5).\n(请检查gdb是否已进行代码签名-请参阅taskgated(8) )

解决方案

这是OS X上一个相对众所周知的问题(顺便说一句,在脖子上开发C ++)。首先,您需要安装g ++和GDB调试器(因为OS X上的Eclipse尚不支持将LLVM clang ++与LLVM调试器结合使用)。最简单的方法是通过 macports 。首先通过本机安装程序安装Macports ,然后从终端安装g ++和gdb(调试器)

  sudo端口安装gcc5#或gcc49 

  sudo port install gdb 

此后,您需要对其进行代码签名,查看此链接。调试器的名称将为 ggdb 非gdb ),而macoprts会将其安装在 / opt / local / bin / ggdb


i've been trying for a whole day to use Eclipse but i failed every time. I know that i may be wrong and i do know that there are a lot of people out there who are working hard for an open source project, but if i can't use a program, run and debug an "Hello world" file, there must be something wrong.

I'm using OSX 10.9.5 (yeah, maybe using a mac is my first error, right?).

Every time i try to debug the "Hello World.cpp" program i get the following error.

http://imgur.com/RgXCSyW

Yes, i've searched everywhere on google. Yes, i've already seen the other replies on a similar topic and i've already tried the solutions they offered. Sadly, it didn't work.

Thanks guys for your patience, i hope to learn how to code and maybe being helpful to others one day.

Luca

p.s. writing the error so other people who are googling it can find it

" 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 33383: (os/kern) failure (0x5).\n (please check gdb is codesigned - see taskgated(8)) Unable to find Mach task port for process-id 33383: (os/kern) failure (0x5).\n (please check gdb is codesigned - see taskgated(8)) "

解决方案

This is a relatively well known "issue" on OS X (which btw is a pain-in-the-neck-to-develop-c++ on). You first need to install g++ and GDB debugger (since LLVM clang++ in combination with LLVM debugger are not yet supported by Eclipse on OS X). The easiest way is via macports. First install macports via the native installer, then, from a terminal, install g++ and gdb (debugger)

sudo port install gcc5 # or gcc49

and

sudo port install gdb

After this, you need to codesign it, see this link. The name of the debugger will be ggdb (not gdb), and macoprts will install it in /opt/local/bin/ggdb.

这篇关于适用于Mac的Eclipse C ++ GDB调试器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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