1

Eclipse (Mars) version (C programming language): Eclipse IDE for C/C++ Developers eclipse.buildId=4.5.0.I20150603-2000

MacOS version: OS X Yosemite 10.10.3 HW: MacbookPro 15" (mid-2015) Retina

Problem: Debug action causes following error message ("111" is both Project Name, and source 111.c file as well):

window title: "Problem Occurred" Error message: 'Launching 111' has encountered a problem. Could not determine GDB version using command: sudo /usr/local/bin/gdb --version sudo: no tty present and no askpass program specified

As far as I understand - that GBD module was removed from MacOS X, so I probably need to install manually one. I am newcomer in Mac, and trying installing upon different forums - I didn't succeed yet.

Probably, there maybe changes required as well in:

Debug Configurations (Run->Debug Configuration->"Debugger" tab). Or/and as well in: Eclipse -> Preferences -> C/C++ -> Debug -> GDB

Please answer me - who installed recently by him-/her- self. Since old (more than year from now) forums may describe other case compared to problem I need to solve.

Please provide exact steps how to manage.

1

Install with MacPorts

  1. Install Xcode and MacPorts, if not already installed.
  2. Now install the Apple GCC and GDB from MacPorts:

    $ sudo port install gdb-apple $ sudo port install apple-gcc42

Install with Homebrew

  1. Install Xcode and Homebrew, if not already installed.
  2. Now install GDB from Homebrew:

    $ brew tap homebrew/dupes $ brew install gdb

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

  • 1
    And what configuration changes are required in Eclipse IDE itself - to let it know to refer properly to newly this added installation ? Do I need both MacPorts and Homebrew - or they do similar job and any of them is enough ? And what about LLDB which as I understand replaces in MacOS X GDB - is it required as well ? Can't I just install GDB for most minimal changes, like latest Eclipse asks for ? Sorry for many questions - I just spend much time without deeply understand what all this modules stand for. And apple support can't help me till now :( – Leon Kigelman Jul 2 '15 at 20:21
  • 1
    You probably won't have to change anything. If eclipse doesn't see it, go to Preferences->C/C++->Debug->GDB and browse GDB Debugger at /usr/local/bin/gdb. You do not have to install both. I recommend Homebrew package manager since it's easier to install and use. I don't think eclipse needs LLDB (not positive though). – David Corbin Jul 2 '15 at 20:41
  • I performed both install with "MacPorts" and "Homebrew" steps above. But strange behaviour I see is - after closing and reopening Eclipse (without installing or removing any installation in between), it gives again same error message: 'Launching 111' has encountered a problem. Could not determine GDB version using command: sudo /usr/local/bin/gdb --version sudo: no tty present and no askpass program specified". How can I make debugger stable - to work (without error) forever ? Is there any configuration in Eclipse required as well ? Why it can be such unstable ? Please provide steps to fix it. – Leon Kigelman Jul 4 '15 at 19:37
0

In addition to installing from macports / homebrew, on Yosemite you also need to sign the gdb binary. See http://sourceware.org/gdb/wiki/BuildingOnDarwin .

  • Welcome to Ask Different! We generally try and avoid link-only answers, since your answer will instantly lose all helpfulness if the link ever disappears. Could you please edit your answer to add some of the details from the site? Thanks! – user24601 Jul 6 '15 at 12:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .