Error when using GDB in Eclipse: "Command '-list-features' is timed out" - c++

When I try to debug my c++ program in Eclipse (Neon 4.6.2 on mac), the progress bar stops at 33% and the operation eventually times out. I get an error saying:
Error in services launch sequence -
Command '-list-features' is timed out
I've verified my GDB build and uninstalled and reinstalled using brew multiple times. GDB works perfectly in terminal, but I'm not able to run it in eclipse at all and I greatly prefer having a GUI when debugging. I have ensured that the path to the debugger in the eclipse debug configuration is correct. In addition, I've tried adding -g as a debugging flag.
Any help/suggestions would be great!

This sounds like a known problem with CDT 9.2, See Bug 509737. It is fixed for 9.2.1 released in a month or so. Your choices are to downgrade CDT to 9.1 or to install the most recent, but unreleased, build of 9.2.1.

Related

Eclipse debugger error in final launch sequence

For months I've been running Eclipse Juno with CDT to debug my C++ code. Up to a couple weeks ago (when I last tried to debug) everything was working fine. Recently I upgraded my eclipse juno installation to the latest. Building and executing the code in eclipse works fine. But now when I try to launch the eclipse debugger I get the following error:
Error in final launch sequence
Failed to execute MI command:
-break-insert -t -f main
Error message from debugger back end:
Cannot access memory at address 0xfffe9900
Cannot access memory at address 0xfffe9900
I've tried searching online for this error without success. I'm wondering if anyone has any ideas about how to address this.
My environment:
I'm running on Mac OSX El Capitan 10.11.6
My xcode version is: Version 8.0 (8A218a) (with Command line tools installed)
My Eclipse info is:
Eclipse IDE for Java Developers
Version: Luna Service Release 2 (4.4.2)
Build id: 20150219-0600
CDT Version: 8.6.0.201502131403
My Eclipse CDT Tool chain Editor looks like:
Current toolchain: MacOSX GCC
Current builder: Gnu Make Builder
I'm running with GNU gdb (GDB) 7.6.2
This GDB was configured as "x86_64-apple-darwin13.0.0"
I'm guessing that there is some sort of gdb version issue. I'm using whatever gdb version that xcode dropped into /usr/local/bin/
Any ideas would be appreciated.
Thanks, Mike
.
.
.
.
.
Ok. So I ran gdb from the command line and it's behaving a little strangely. If I set a breakpoint anywhere within the main program it results in an error, such as, Cannot access memory at address 0xfffe9900. If instead I set a breakpoint in a function in an external file then run it goes to the proper breakpoint and accepts step, print, continue,.... For some reason I cannot set break points in main without getting the error, Cannot access memory at address 0x............. I'm compiling all the codes (including my main) with the -g option. BTW the error, Cannot access memory at address 0x......... is the same as what I'm getting from eclipse debugger. So it looks like it cannot access the main code memory for whatever reason. I haven't changed my make file either. The only things that changed possibly is gcc and gdb.

gdb in Netbeans-7.4 for C++ debugging

I'm trying to debug my project using the "step-into" function, but each of the debug options (other than Debug Project, Attach Debugger, and Debug Core File) is grayed out. I've checked on both my Linux and Windows machines, and they both have the same problem.
I'm running Netbeans 7.4 with gdb 7.6, seemingly properly loaded under tools->options->C++. Is there possibly a compatibility issue with newer versions of gdb? If so, how can I revert to an older version?
Thanks!
Here are some things you can try:
Remove all breakpoints of your project and try again with a new one
(If possible) test version:
a earlier version of GDB
and newer version of NetBeans (current stable: NB 7.4 SP2 -- testing: NB 8.0 RC1)
Are there any error messages? Please also keep an eye on NetBeans's logfile - on IDE start and debugging
Check your paths, e.g, to compiled binaries / libs
Maybe this Bug can help you: Bug 233683 - Gdb doesn't work with NetBeans 7.3.1
It's posted for 7.3, but maybe it's still in 7.4.

Mac C++/eclipse cannot debug: Error while launching command: gdb --version

I am using c++/eclipse kepler on mac, and I cannot debug any project. The error is "Error while launching command: gdb --version" Besides that, I can build and run my code using other libraries.
I searched a site that is similar to my problem: Debugger for C++ eclipse gives the following error. 'Launching program name' has encountered a ... Error while launching command: gdb --version
But what should I change if I am using a mac?
You can fix this by specifying the full path to gdb. You can do this separately for each debug configuration, and you can also set the default gdb location in the preferences under C/C++ > GDB. For example, if you installed gdb via Homebrew, then it's probably located under /usr/local/bin:
And here's a screenshot of the Preferences:
I still don't know why Eclipse can't find GDB even though it is on my path. I guess it doesn't use my .bash_profile or my .bashrc? You could try symlinking gdb into /usr/bin. Maybe Eclipse will look there.
Edit: I tried the symbolic link idea and now Eclipse can debug, but it crashes inexplicably while doing so! So, I guess... don't do that?
This guide from a UC Irvine Computer Science professor's page is a very well-written, detailed, and Mac-specfic description of all the steps involved in installing GDB, creating a certificate, signing GDB using that certificate, and finally configuring Eclipse. I was found this very helpful as someone unfamiliar with each of these steps.
GDB Installation on Mac OS X
I had the same problem. I solved it by:
Install a gdb - ( I used 7.8.1) - compile and install it. It got installed in usr/local/bin
Codesigning certificate
Open eclipse executable using sudo. Otherwise I still get the error.
I am on OS X.
Hope this helps.
I had this error too now, and spent more than an hour looking for it.
In my case, the path was correct, and eclipse seemed to fail to start "any" executable as debugger. (I tested with gksudo cat, but it clearly never got to effectively running it).
The final reason was that I had put in my eclipse.ini -Xms1G and -Xmx1G. It seemed to already use the full memory for the indexer, and trying to allocate some more memory to start the debugger failed with an "unkown" error. Removing the memory limitations fixed the issue.
Hope this helps someone
I had many difficulties making GDB to work on Eclipse. I tried LLDB instead and it worked like a charm:
https://wiki.eclipse.org/CDT/User/FAQ#How_do_I_get_the_LLDB_debugger.3F
This can be a more convenient alternative for Mac users.
Mac OS Sierra 10.13.6 gdb 8.0.1
had the same error as topic-starter.
first, I set the path as Neil Traft (here in the answers) explains to usr/local/bin/gdb;
But it didn't work.
I found these instructions:
https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d
and I discovered that I already had gdbcert1 in my System. So I followed everything from 7. Works!

Debugger for C++ eclipse gives the following error. 'Launching program name' has encountered a ... Error while launching command: gdb --version

I've always worked around the debugger issue, but now it has gotten too annoying. I'm working on more complex programs and can't anywhere if I cant debug my programs. Has any one else been able to fix this issue in eclipse? It works for java, but not more my C++ plugin from minGW
Debbugger for C++ eclipse gives the following error. 'Launching program name' has encountered a problem. Error while launching command: gdb --version
Assuming you are using Windows and have MinGW installed, you only need to locate the gdb executable in the MinGW bin folder. This can be done on the "Main" tab in the "Debugger" configuration of Eclipse:

Mountain Lion no working gdb debugger

I got a new Macbook Air and installed XCode 5 on it. To my surprise Apple does no longer ship gdb with the command line tools. As I am doing lots of c++ coding I am dependent on a good debugger.
What I tried so far:
Install gdb 7.6 via macports and signed the binary.
Debugging from QT-Creator is possible. It stops at the breakpoints but I see no information at all about the stack. Using lldb not possible, I get a weird python error.
Debugging from Netbeans is not possible at all. The Debugger is not stopping at any breakpoint. Apart from that Netbeans is not working with lldb.
Working with XCode is no problem. Everything works as expected.
Problem is I need an IDE that can do remote debugging as I have several Raspberry Pi projects. Developing software directly on the pi with vim is fun but not suitable for bigger projects.
So the question is, has anyone a working debugger on Mountain Lion with XCode 5 installed? IDE in question needs to support remote debugging (eg QT-Creator, Netbeans, Eclipse)
Thank you!
Install Xcode 4.6.3. If you have a developer's account it's available for download at http://developer.apple.com
Encountered the same problem. Finally installed command line tools from xcode 4.6.1 on ML. This package is available on Apple site. It installed GCC-LLVM 4.2.1 and GDB 6.5. Qt Creator was able to build application and start debugging. Debugging is not stable too much; but i can to see call stacks, values and stop on breakpoints. I use it for 32bits build - maybe it matters.
You could also switch from GDB to using the LLDB debugger (although the Qt support is early for this).
See http://stanford.edu/~rawatson/lair/mac.html