Search code examples
c++eclipsegdbeclipse-luna

Eclipse Luna GDB debugger support


I'm having some issue with gdb on my mac running 10.8.5. Specifically the GDB install is not code signed and must be ran as root. This has become problematic and limits my ability to utilize GDB from with in eclipse luna. I have tried 99% of the options available to code sign GDB with a certificate to no success.

What can I do to get GDB to work in Eclipse luna and display variables and data structures?

enter image description here

With the gdb-apple debugger I get the following error when stepping in to code. FAILED to execute MI command.

enter image description here


Solution

  • You need to install gdb as Eclipse won't work with the lldb debugger that comes with clang++. Right now I guess you have only an alias for gdb pointing to the lldb debugger, so you need to install the proper GNU gdb. Easiest way is via macports,

    sudo port install gdb
    

    then codesign the /opt/local/bin/ggdb (note the name, ggdb not gdb). Here is a link which explains how to codesign it (skip the installation part, go to Certifying GDB)

    http://ntraft.com/installing-gdb-on-os-x-mavericks/

    PS: the method in the link is applicable to older versions of OS X, not just Mavericks.