Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse C++ GDB debugger for Mac

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)) "

like image 724
Luca Soato Avatar asked Apr 27 '15 22:04

Luca Soato


2 Answers

There is another option to debug you code using LLDB debugger. You can check this link for install the LLDB debugger integration. It is super easy and does the work.

Btw The GDB debugger is part of GNU. Xcode does not use GNU tools (gcc, gdb) anymore. Xcode uses LLVM. LLVM's debugger is LLDB. Some info about it: apple developers, The LLDB Debugger Probably your problem has been solved, but sharing another solution to others cant be bad :)

This is relevant to macOS Sierra also.

like image 80
Adi Azarya Avatar answered Oct 07 '22 01:10

Adi Azarya


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.

like image 38
vsoftco Avatar answered Oct 07 '22 01:10

vsoftco